How to do cla reset UIAxes in ML2021a

조회 수: 35 (최근 30일)
endystrike
endystrike 2021년 5월 12일
편집: endystrike 2021년 5월 12일
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! :)

채택된 답변

Adam Danz
Adam Danz 2021년 5월 12일
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
endystrike
endystrike 2021년 5월 12일
편집: endystrike 2021년 5월 12일
cla(app.UIAxes, 'reset');
Adam your code works perfectly in 2021a, thanks a lot! :)

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Instrument Control Toolbox Supported Hardware에 대해 자세히 알아보기

제품


릴리스

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by