update UIAxes when change values in a table in app Designer

2 ビュー (過去 30 日間)
Marco Picillo
Marco Picillo 2021 年 4 月 1 日
コメント済み: Marco Picillo 2021 年 4 月 1 日
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 件のコメント
J. Alex Lee
J. Alex Lee 2021 年 4 月 1 日
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 2021 年 4 月 1 日
thank you! Now it works properly

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeDevelop Apps Using App Designer についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by