Appdesigner 'Value' must be double scalar

I am trying to pass numerical values into the Numeric Edit Field on appdesigner. The values are being extracted from the sensor and displayed in a csv file using PuTTy. The csv file is continuously updating and I can view the results in matlab command window as the results update on PuTTy in realtime. However when I try to view it in appdesigner I get the error 'Value' must be double scalar. I'm not sure how I can solve this. Kindly assist

 Respuesta aceptada

Cris LaPierre
Cris LaPierre el 24 de Mayo de 2022
Editada: Cris LaPierre el 24 de Mayo de 2022

0 votos

The Value property can only be a single numeric value (that's what is meant by 'double scalar'). It is likely the result of csvread is an array instead.
Try modifying your app designer code to app.EditField.Value = x(end);
Another issue might be if x is not a double. In that case, you would need to covert the value ot a double too: app.EditField.Value = double(x(end));

3 comentarios

Walter Roberson
Walter Roberson el 24 de Mayo de 2022
each of those csvread is going to pull in the entire file as it is at that point.
If the putty process is adding to the end of file, that is more and more elements over time.
If putty is rewriting the file, there is a possibility of reading it while it is empty.
Cris LaPierre
Cris LaPierre el 24 de Mayo de 2022
Good point. The code specifies the starting row and column, but that does not constrain to to a single value, or a specific column. All contents in the file after the starting point are read in.
If it is value (2,0) that you want each time, perhaps try app.EditField.Value = x(1);
Lola
Lola el 24 de Mayo de 2022
The app.EditField.Value = x(end) solves this error. I wanted to view the results in realtime and that works perfectly.
Thank you so much for the help and insight on other potential errors

Iniciar sesión para comentar.

Más respuestas (0)

Etiquetas

Preguntada:

el 24 de Mayo de 2022

Comentada:

el 24 de Mayo de 2022

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by