name several curves within a loop
조회 수: 6 (최근 30일)
이전 댓글 표시
Hello,
I am plotting about 80 curves on the same plot.
In order to differentiate between each curve, i would like to name each curve on the plot within the for loop shown below:
for k = 1:80
[a,b]=test(a1,b1);
labels = cellstr(num2str([k]')); % not sure about this one*bold*
h=plot_curves(a, b, 'r',5);
hold on
end
Thanks,
Ash
댓글 수: 0
채택된 답변
추가 답변 (1개)
Walter Roberson
2012년 9월 4일
labels{k} = num2str(k);
Then at the end of the loop,
legend(labels)
This assumes that plot_curves is constructing exactly one line object per loop iteration.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Fit Postprocessing에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!