App Designer - Plotting from Arrays

3 Ansichten (letzte 30 Tage)
SteveM
SteveM am 19 Okt. 2022
Kommentiert: SteveM am 19 Okt. 2022
I would just like to plot the values from 2 colums of an array:
x = app.Attitude_input{:, 1};
y = app.Attitude_input{:, 2};
plot(app.UIAxes, x, y);
But I always get this error:
Error in Plotting_APP/PlotButtonPushed (line 178)
x = app.Attitude_input{:, 1};
Surely this should be simple...but I can't find any solution. Any ideas?
Thanks

Antworten (1)

Allen
Allen am 19 Okt. 2022
If the data type of your x and y variables is a double-array, then you are using the wrong syntax to access the data. Use parenthesis, (), in lieu of curly brackets, {}. Curly brackets would be applicable if the x and y variables contain table data.
  1 Kommentar
SteveM
SteveM am 19 Okt. 2022
Thanks for the suggestion, but I tried this first (yes the data is stored as doubles").
Same result... error.

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Data Distribution Plots finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by