Recently I’ve found this script «Real time Data plot from serial port» back from 2010 on MathWorks blogs. Just want to say thanks, it is simple and helpful example. In other words, this not sophisticated code easy to understand and change in any way. To Dimit: you must add terminator (0x0D, 0x0A) after each value of data in your transmission, in basic terminal programs this means to turn on «Send line feeds with carriage return» (or CR=CR+LF). Also could be helpful any “Virtual Serial Port” while debugging without external device.
When I run this code I get the following error. What should I do ?
??? In an assignment A(I) = B, the number of elements in B and
I must be the same.
Error in ==> real_time_data_serial at 80
voltage(count) = fscanf(s,'%f');