How can I solve a subscript dimension mismatch problem reading from serial buffer using Arduino?
Show older comments
Problem: After approx 350 readings from serial buffer I get the following error....
??? Subscripted assignment dimension mismatch.
Error in ==> Pressure_Sensor_Scope_v2>togglebutton1_Callback at 229
Pressure(i,:) = str2num(tline);
When working, Pressure(i,:) looks like this....
-0.41 -0.30 18.42
When it fails, Pressure(i,:) looks like this....
-0.46 -018.47
When I use Arduino's serial monitor, the readout just runs perfectly for as long as I've tried, approximately 2 minutes as opposed to the 18 seconds with Matlab.
I should add that tline is read from...
[tline,count] = fgets(obj);
where: obj = serial(com_port);
Thank you for your time.
Accepted Answer
More Answers (0)
Categories
Find more on MATLAB Support Package for Arduino Hardware in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!