Change name of a graph inside loop automatically.

2 ビュー (過去 30 日間)
Ali Kareem
Ali Kareem 2015 年 11 月 24 日
コメント済み: Stephen23 2015 年 11 月 24 日
Hi,
I have a loop from one to ten. for each loop I got graph. My question is can I change the name of graph automatically?
For example. first graph will have name (Result for experiment number 1)
second graph will have name (Result for experiment number 2),
and so on for all ten graphs
Regards

回答 (1 件)

Stalin Samuel
Stalin Samuel 2015 年 11 月 24 日
for i=1:10
figure(i)
title(sprintf('Result for experiment number %d',i))
end
  1 件のコメント
Stephen23
Stephen23 2015 年 11 月 24 日
Note that it is recommended to avoid the variable names i and j, as these are both names of the inbuilt imaginary unit.

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

カテゴリ

Help Center および File ExchangeGraph and Network Algorithms についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by