How can I change the title of a figure in a for loop?

28 vues (au cours des 30 derniers jours)
Hugo Ochoa
Hugo Ochoa le 5 Juil 2016
Modifié(e) : Stephen23 le 5 Juil 2016
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');

Réponse acceptée

the cyclist
the cyclist le 5 Juil 2016
for ii=1:3
figure
title(['This is title ',sprintf('%d',ii),'. Enjoy.'])
end

Plus de réponses (0)

Catégories

En savoir plus sur Loops and Conditional Statements dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by