Automaticly generate plots and different legend
6 ビュー (過去 30 日間)
古いコメントを表示
Hi,
let k is variable. For example, if k=3, then I will have speed1 speed2 speed3.
How can I automaticly generate one plot with all speeds and also different legend for each one?
Thanks
ps:t=0:0.01:100
0 件のコメント
採用された回答
Azzi Abdelmalek
2013 年 3 月 21 日
編集済み: Azzi Abdelmalek
2013 年 3 月 21 日
t=0:0.01:100
speed1=cos(0.01*t);
speed2=sin(0.05*t);
speed3=cos(0.1*t);
y=[speed1;speed2;speed3];
plot(t',y');
for k=1:size(y,1)
leg{k}=sprintf('speed%d',k);
end
legend(leg);
6 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Vector Fields についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!