update UIAxes when change values in a table in app Designer
3 次查看(过去 30 天)
显示 更早的评论
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
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
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Develop Apps Using App Designer 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!