I would like to store data received from the serial continuously in order to plot them in a graph. I've tried collecting the data in a while loop
while (get(serial, 'BytesAvailable')~=0)
storeAndPlot()
end
but the program is not able to execute other tasks in the meanwhile.
In this question they use a timer to specify the delay, in seconds, between executions of function. This could be a solution using a short period, such as 0.1, to invoke a getDataFromSerialFunction() and update the graph.
Is there a kind of callback function to invoke once the data is available from the serial?