how can I let the string variable change in a loop
1 回表示 (過去 30 日間)
古いコメントを表示
Dear fellows,
I am trying to plot the scatter for a set of vectors. My secource file pf.mat is a 65*154 matrix. I want to plot two columns each time so I am writing a loop (i=1:77)from 1 to 77. In each loop, after plot the vectors, I would to save the image as the number of the i. My questions is how do I name the image then it can change as th loop goes on? My current code only can save the image as the letter i, but not the actual number of i. Here is my code
if true
% load pf
for i=1:77
scatter(pf(:,(2*i-1)),pf(:,2*i),'.')
hold on
plot([0,100],[100,0])
h(i)=scatter(pf(:,(2*i-1)),pf(:,2*i),'.');
saveas(h(i),'i', 'pdf')
end end
0 件のコメント
採用された回答
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Scatter Plots についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!