ライブスクリプトの出力をクリアする方法
이전 댓글 표시
figureが表示されるライブスクリプトを作成しています。
for文で複数のデータを回す際に、すべてのfigureが右画面に蓄積されていき、重くなってしまいます。
出力しないようにfor分内に、clfやcloseを入れてもクリアできません。
何か解決方法はありますでしょうか?
댓글 수: 2
Dyuman Joshi
2023년 9월 16일
Google translation -
Title > How to clear live script output
Description > I am creating a live script where a figure is displayed.
When passing multiple data using a for statement, all the figures accumulate on the right screen and become heavy.
Even if you put clf or close in the for section to prevent output, it cannot be cleared.
Is there any solution?
Dyuman Joshi
2023년 9월 16일
Could you please share the code you are working with?
채택된 답변
추가 답변 (1개)
Hiroshi Iwamura
2023년 9월 19일
clear
close all
f = figure;
f.Visible = "off";
for n=1:5
plot(rand(10,2))
% drawnow % この2行は確認用
% pause(0.5)
end
ではいかがでしょう?
f.Visible = "on"; にしてしまうとポップアップするので、普通に表示させたい場合は4行目をコメントアウトします。
댓글 수: 2
Hiroshi Iwamura
2023년 9월 19일
あるいは描画が重いようであれば、データだけを書き換えるようにすると、少しは早くなります。
for n=1:5
if n == 1
p = plot(rand(10,2));
else
y = rand(10,2);
p(1).YData = y(:,1);
p(2).YData = y(:,2);
end
end
flower
2023년 9월 20일
카테고리
도움말 센터 및 File Exchange에서 グラフィックス オブジェクトの識別에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!