subplot in loop and save final figure, when clear all used after each loop

for a=1:24 body subplot(24,6,a) clear all; end
please help;

2 件のコメント

Adam
Adam 2016 年 6 月 23 日
What is the question?
Bhowmik.U
Bhowmik.U 2016 年 6 月 23 日
question is how to plot subplot, each plot in a in loop, where at end of each loop I am doing clear all;

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

回答 (1 件)

Jos (10584)
Jos (10584) 2016 年 6 月 23 日

0 投票

Generally the use of clear all is not to be recommended, except at the beginning of a script. You can use CLEARVARS to free memory, which makes your code also much more readable.

4 件のコメント

Bhowmik.U
Bhowmik.U 2016 年 6 月 23 日
Thanks for the suggestion,....by the way will that also help in subplotting in loop?
Jos (10584)
Jos (10584) 2016 年 6 月 23 日
subplot and clear have little to do with each other. Did you read the help and documentation?
Bhowmik.U
Bhowmik.U 2016 年 6 月 24 日
yes I did I suppose
But cant figure out
my code: for a=1:1:24 code figure(ii) subplot(4,6,ii) plot(...) clearvars hold off; end
one figure gets replaced by other...........I dont get 4*6 plots.
Jos (10584)
Jos (10584) 2016 年 6 月 24 日
Use
subplot(4, 6, a)
rather than subplot(4,6, ii)

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

タグ

質問済み:

2016 年 6 月 23 日

コメント済み:

2016 年 6 月 24 日

Community Treasure Hunt

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

Start Hunting!

Translated by