Plot figures in loop as superimposed top on top
조회 수: 2 (최근 30일)
이전 댓글 표시
Similar questions should have been asked however I couldn't get a solution.
Plot can superimpose these loop figures onto one another:
figure();
hold all
for i=1:2:11
y=i;
plot(x,y);
end
However, interestingly can't do the same here:
figure();
hold all
for i=1:2:11
y=x.^i;
plot(x,y);
end
What it does is plotting only the last figure. Any ideas why is this?
댓글 수: 0
답변 (1개)
KSSV
2016년 11월 19일
편집: KSSV
2016년 11월 19일
Used hold on after the plot inside loop.
댓글 수: 5
Image Analyst
2016년 11월 20일
Is x a vector or scalar? What is/are its value(s) exactly? Give code to generate x.
참고 항목
카테고리
Help Center 및 File Exchange에서 Annotations에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!