plot command for multiple plots in single figure

Hello , i have a function where i make a change to the imput vector each time.
is there a way when i push play then the old plots will be saved on the figure while the new one will appear with them on the same figure?
instead of doing multiple copies of the same function and multiple vectors to compare the change in the output from one vector to the other.

답변 (1개)

Voss
Voss 2022년 1월 5일
Use hold on
my_plot(1:10);
my_plot(12:25);
function my_plot(in)
figure(1);
hold on;
plot(in);
end

카테고리

도움말 센터File Exchange에서 Graphics Objects에 대해 자세히 알아보기

태그

질문:

2022년 1월 5일

답변:

2022년 1월 5일

Community Treasure Hunt

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

Start Hunting!

Translated by