update UIAxes when change values in a table in app Designer

2 Ansichten (letzte 30 Tage)
Marco Picillo
Marco Picillo am 1 Apr. 2021
Kommentiert: Marco Picillo am 1 Apr. 2021
hi,
i have a UITable, UIAxes and a button. My program plots a wing giving some data from the table. I want to update the plot when i change the values in the table and press the button. I tried to set the UIAxes property: next plot---->replace children and replace all, but it doesn't work, the program add the new plot to the older. How can i delete the older plot? This is a piece of the code
function ButtonPushed(app, event)
%take data from the table
app.geo.c=str2double(app.UITable_wing.Data(1,6));
app.geo.dihed=str2double(app.UITable_wing.Data(1,9))*(pi/180);
app.geo.b=str2double(app.UITable_wing.Data(1,11));
app.g = ....
app.ref =....
%plot
geometryplot1(app.g,app.geo,app.ref,app.UIAxes)
end
how can i fix the problem?
Thank you!
  4 Kommentare
J. Alex Lee
J. Alex Lee am 1 Apr. 2021
can you just call "cla(axHandle)" inside your geometryplot1 function?
My choice would be to have a plot initializer if the "things" you plot is always the same, and in your plot updater just update the data associated with each plot handle.
Maybe an even better way with more modern matlab would be to use the custom charts mechanism
Marco Picillo
Marco Picillo am 1 Apr. 2021
thank you! Now it works properly

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Kategorien

Mehr zu Develop Apps Using App Designer 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