MATLAB: Window title of figures in a for loop

figurefor loopiiititlewindow

Please help!
I have two different loops. One that works with ii and one that works with i. Both of these loops need to plot figures but use different files. They are now plotted as follows: figure(i) and figure (ii+3) — (3 because the i loop only needs to plot 3 figures). How can I change the titles for these figures? So that they correspond with the filename.

Best Answer

try this, within your loop:
f=figure(i);
title('my title');
set(f,'Name','my window title');