Plot on different figures during a loop
1,294 次查看（过去 30 天）
I'm extracting from different files some data that have ot plot on the same plot, I use a loop like
figure, hold on
I'd like to plot t(:,1),t(:,2) on figure 1, and for example t(:,1),t(:,3) on another figure. Is it possible to do it in the same loop?
thanks for your help
the cyclist 2011-7-28
Yes. When you call the figure() command, call it with an input argument:
Then, before you do the particular plotting command, call figure() again, using the input argument that you want to plot to:
When the figure number already exists, it makes that figure current.
You might want to read "doc figure", "doc gcf", and "doc hold" to make sure you don't overwrite the plot that is already there in that figure.
Kehinde OROLU 2011-7-28
Use this instead: