I have looked at the online help the very first line reads:
"The num2str function converts numbers to their string representations. This function is useful for labeling and titling plots with numeric values."
This is exactly what I want to use it for, I have to plot a function every time a for loop reiterates itself And I want to change the title of each successive plot to "plot1" "plot2" "plot3" and so on....
But I have not found a way to do this.

 採用された回答

Wayne King
Wayne King 2012 年 6 月 8 日

0 投票

Hi, here is an example:
for nn = 1:10,
plot(randn(100,1));
title(['plot' num2str(nn)]);
pause(0.5);
end

1 件のコメント

Nathaniel
Nathaniel 2012 年 6 月 8 日
This is perfect!!
Thank You

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File Exchange で Introduction to Installation and Licensing についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by