Hi,
I have a script that generates a list of plots and outputs it as a pdf.
Now sometimes I have to reorder the plots which means having to re-numbering the figure numbers.
*_Example:
figure(1)
Plot(.......
%%%%%%%%%%%%%%%%%%%%%%
figure(2)
Plot(.......
%%%%%%%%%%%%%%%%%%%%%%
figure(3)
Plot(....... _*
Is there any way round this? using a loop such as
i = i + 1
and then use figure(i) instead?
I can't seem to get it to work
Thanks

4 件のコメント

Jan
Jan 2012 年 4 月 3 日
The loop sounds fine. What is the problem with it?
Aadil
Aadil 2012 年 4 月 3 日
Everytime I run the script it seems to start from the last number used and not from 1.
Is there anyway to reset the loop without having to clear all?
Also is there anyway of doing this without having to write i = i + 1 before each graph?
Thanks
Walter Roberson
Walter Roberson 2012 年 4 月 3 日
You could start with
i = 1
so that it doesn't start from the last number.
Aadil
Aadil 2012 年 4 月 3 日
yeah just realised that a second ago LOL
Thanks

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

 採用された回答

Aadil
Aadil 2012 年 4 月 23 日

0 投票

answered by walter

1 件のコメント

Daniel Shub
Daniel Shub 2012 年 4 月 23 日
You may want to loop over ii instead of i. The variables i and j are special and start with the value of sqrt(-1) and ideally should not be overwritten since other scripts might depend on them having there initial values.

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

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeLoops and Conditional Statements についてさらに検索

質問済み:

2012 年 4 月 3 日

Community Treasure Hunt

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

Start Hunting!

Translated by