How to clear figures in Live Editor in 2020b?

조회 수: 142 (최근 30일)
fengwuxiaoli
fengwuxiaoli 2020년 10월 2일
댓글: Nathaniel H Werner 2022년 6월 17일
I just update to 2020b and notice there are some differences in the new release. First, "Run section" and "Section break" buttons are exchanged. I guess this is due to the usage of "Run section" is more frequenctly than the usage of "Section break". However, this is not compactible to classic editor. "Run section" in classic editor has identical position as "Section break" in live editor, which results in some inconvineince. Second, I cannot clear figures with "Clear all output". I would like to clear all figures and plot new figures in new execution, however, the old figures cannot be removed. No matter of what I do, they are still there. "Clear all output" does work in 2020a. I don't know why it doesn't work in 2020b.
  댓글 수: 7
Nitin Kapgate
Nitin Kapgate 2020년 10월 9일
편집: Nitin Kapgate 2020년 10월 9일
Hi Ryan, can you share the representative code which is causing this issue so that I can reproduce the same issue on my side?
fengwuxiaoli
fengwuxiaoli 2020년 10월 9일
x = 1:256;
figure(1000)
plot(x,x), hold on
legend
Below is the figure I plot and "clear all output" four times. There is supposed to be only one line in the figure.

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

답변 (1개)

Michael Ramseier
Michael Ramseier 2020년 10월 6일
I found a little work around:
When you put clf (clear current figure - https://ch.mathworks.com/help/matlab/ref/clf.html) before the plot command it works. But in my opinion that's not the way the live editor should work.
  댓글 수: 4
fengwuxiaoli
fengwuxiaoli 2021년 10월 19일
It works fine if I run the script from beginning. However, if I only run the section, the figure is still there.
Nathaniel H Werner
Nathaniel H Werner 2022년 6월 17일
This is a consistent "bug"/issue that has been described for the live editor since near it's inception and has not been addressed.

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

카테고리

Help CenterFile Exchange에서 Interactive Control and Callbacks에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by