フィルターのクリア

Naming different Lines And Figures inside a for loop

1 回表示 (過去 30 日間)
Ahmed
Ahmed 2013 年 2 月 10 日
this code gives me 14(Smax) figure and inside each one there are 13(Nmax))different line, what i am tring to make is to give every line a different number and each figure a different Name, how i can make this Thx in Advace
if true
PDD(i,:)=[dp(i1,j1,k1),PD(i1,j1,k1)];
for ch=1:(Nmax*dmax):(Nmax*dmax*Smax)
figure
hold on
for k3=ch:dmax:(ch+((Nmax*dmax)-1))
plot(PDD((k3:k3+dmax-1),1),PDD((k3:k3+dmax-1),2)); %1 st Curve
xlabel('Plunger Size (in)');
ylabel('Pump Dispacment(BPD)');
end
end
end
  2 件のコメント
Azzi Abdelmalek
Azzi Abdelmalek 2013 年 2 月 10 日
What do you mean by to give a number to a line
Ahmed
Ahmed 2013 年 2 月 10 日
to name it for Example the first line in the loop is text on it 1 , the second 2 and so on.

サインインしてコメントする。

採用された回答

Azzi Abdelmalek
Azzi Abdelmalek 2013 年 2 月 10 日
To save a figure use after the first loop
hgsave(gcf,sprintf('fig%d',k3))
For the name line use text command
  1 件のコメント
Ahmed
Ahmed 2013 年 2 月 12 日
thx Azzi you are the Master Of Charts Man :)

サインインしてコメントする。

その他の回答 (1 件)

the cyclist
the cyclist 2013 年 2 月 10 日
If you assign "handles" to the figures and plots ...
hf(ch) = figure(...)
and
hp(k3) = plot(...)
then you can later refer back to the handles to do manipulations with them.
See this page of the documentation for details: http://www.mathworks.com/help/matlab/graphics-objects.html
  1 件のコメント
Ahmed
Ahmed 2013 年 2 月 12 日
thank you sir :)

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeAnnotations についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by