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

조회 수: 14 (최근 30일)
Swasti Saxena
Swasti Saxena 2016년 10월 27일
댓글: Swasti Saxena 2016년 10월 27일
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개)

카테고리

Help CenterFile Exchange에서 Graphics Performance에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by