Legend in plot with a loop
古いコメントを表示
Hi,
I have some data which plots 48 different figures for 48 different points. I want to have some kind of loop which can be used in the Legend command for the plotting so that I don't have to write the Legend for the figures. I have the 48 points in a variable =a in the workspace.
for j=1:48
figure;
normB48points=(normB(:,j));
plot(t',normB48points);
xlabel('time in seconds (t)');
ylabel('flux densities in Tesla (T)');
legend('flux densities at point');
end
採用された回答
その他の回答 (1 件)
Hassan Bhatti
2019 年 2 月 22 日
0 投票
4 件のコメント
Rakhi Agarwal
2019 年 2 月 22 日
There's an error because one bracket is not closed.
name = ['Flux densities at ', num2str(a(1,j),',', num2str(a(2,j))];
Hassan Bhatti
2019 年 2 月 22 日
Hassan Bhatti
2019 年 2 月 22 日
Rakhi Agarwal
2019 年 2 月 22 日
Thanks! :D
カテゴリ
ヘルプ センター および File Exchange で Legend についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!