Effacer les filtres
Effacer les filtres

Headings for graphs generated in a loop

1 vue (au cours des 30 derniers jours)
Tom
Tom le 28 Jan 2013
Hello,
Can anyone tell me how to go about having separate headings for graphs (and histograms) generated in a loop?
Thanks.

Réponse acceptée

Thorsten
Thorsten le 28 Jan 2013
myheadings = {'first title' 'seccond title' 'yet another title' 'and so one'};
for i = 1:4
plot(rand(1,10))
title(myheadings{i})
pause(1)
end
  4 commentaires
Thorsten
Thorsten le 28 Jan 2013
Make sure to use curly braces
myheadings{i}
and that i is the index variable in your loop. Try the example.
Tom
Tom le 28 Jan 2013
Yep. My brackets weren't curly enough. Thanks again.

Connectez-vous pour commenter.

Plus de réponses (0)

Community Treasure Hunt

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

Start Hunting!

Translated by