How can I solve a subscript dimension mismatch problem reading from serial buffer using Arduino?
Mostrar comentarios más antiguos
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.
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre MATLAB Support Package for Arduino Hardware en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!