Headings for graphs generated in a loop

1 次查看(过去 30 天)
Hello,
Can anyone tell me how to go about having separate headings for graphs (and histograms) generated in a loop?
Thanks.

采纳的回答

Thorsten
Thorsten 2013-1-28
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 个评论
Thorsten
Thorsten 2013-1-28
Make sure to use curly braces
myheadings{i}
and that i is the index variable in your loop. Try the example.
Tom
Tom 2013-1-28
Yep. My brackets weren't curly enough. Thanks again.

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Title 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by