Hold plot toggle using app designer
22 次查看(过去 30 天)
显示 更早的评论
I am using the app designer to create a UI with a graph (app.Graph), a hold switch (app.HoldGraphSwitch) and a calculate button (app.CalculateButton).
I want it so when the hold switch is set to 'on', then the graph holds the previous plots on the graph but if set to 'off, then the graph clears previous plots.
I have tried the following but does not clear the graph:
function CalculateButtonPushed(app, event)
if app.HoldGraphSwitch.Value==0
hold(app.Graph, 'off')
else
hold(app.Graph, 'on')
end
plot(app.Graph,x,y)
end
Any solutions would be appriciated :) Thanks!
0 个评论
采纳的回答
Cris LaPierre
2018-11-9
The hold command only tells it how to treat the next plot. Clearing your axes is a different process. There are numerous ways to do it, so it depends what functionality you want.
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!