How to do cla reset UIAxes in ML2021a

34 views (last 30 days)
Until MatLab 2020a I used to code this to reset the axes of a plot in AppDesigner code:
app.UIAxes.cla('reset');
but unfortunately in MatLab 2021a this command doesn't work anymore. How can I do the same in R2021a?
Thanks! :)

Accepted Answer

Adam Danz
Adam Danz on 12 May 2021
On what version of Matlab has that syntax ever worked? Even on regular axes, the error message appear.
fig = figure('Visible','off'); % visible=off to simplify the display
ax = axes(fig);
ax.cla
Unrecognized method, property, or field 'cla' for class 'matlab.graphics.axis.Axes'.
Instead, use
cla(app.UIAxes, 'reset')
  1 Comment
endystrike
endystrike on 12 May 2021
Edited: endystrike on 12 May 2021
cla(app.UIAxes, 'reset');
Adam your code works perfectly in 2021a, thanks a lot! :)

Sign in to comment.

More Answers (0)

Categories

Find more on Graphics Object Programming in Help Center and File Exchange

Products


Release

R2021a

Community Treasure Hunt

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

Start Hunting!