MATLAB: How to change the title of a figure in a for loop

figuresfor looploopsparfor

In this circle, I want to change the title, so in each iteration I can see in the title the number of that iteration
for i=1:m
fig=figure(i+2);clf;
stem(t,real(X(:,i)));
set(fig, 'Position', [30 40 850 650])
xlabel({'Tiempo con unidades de tiempo uniforme, 0 \leq t \leq pi/2'},'FontSize',13,'FontWeight','bold');
ylabel('Amplitud','FontSize',13,'FontWeight','bold');
title ({fprintf 'Iteracion i' *(THIS OF COURSE DOES NOT WORK)*},'FontSize',13,'FontWeight','bold','Color','r');
Y(:,i) = xcorr(z,real(X(:,i)),0,'coeff');

Best Answer

for ii=1:3
figure
title(['This is title ',sprintf('%d',ii),'. Enjoy.'])
end