Plotting multiple plots on the same graph using a 'for' loop

The hold on command is not working in a 'for' loop, and I am ending up with 50 separate plots. How do I plot them on a single graph?

 채택된 답변

Walter Roberson
Walter Roberson 2016년 10월 27일
Do not use figure() within the for loop.
figure(); %outside the loop
for K = 1 : 20
plot(rand(1,75));
hold on
end

추가 답변 (0개)

카테고리

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

태그

질문:

2016년 10월 27일

댓글:

2016년 10월 27일

Community Treasure Hunt

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

Start Hunting!

Translated by