I am trying to plot real time serial values over matlab but i could not succeed it by any demo . My embedded system is already sending data which is checked by serial terminal. When I am trying to get them over matlab there is an error like that :
Warning: Matching failure in format.
??? In an assignment A(I) = B, the number of
elements in B and
I must be the same.
Error in ==> real_time_data_plot at 81 voltage(count) = fscanf(serialObject,'%f'); %#ok<SAGROW>
as a serial in matlab I am using this file : http://www.mathworks.com/matlabcentral/fileexchange/25519-collect-and-plot-data-from-an-instrument-in-real-time in embedded side, I am just sending fixed value which is 100 to reduce the error case probabilities as
sprintf(str,"%d\n",100);
USART_puts(USART2,str);
The code can plot a couple of samples but a bit later it is crashing with above error notification. Do you have any suggestion ? Thanks