plotting a figure with a variable as title

Hi, i want to plot a graph and the title of that graph should be equal to the variable mx1. how can i implement that?

 採用された回答

Image Analyst
Image Analyst 2014 年 12 月 25 日

1 投票

Try something like this
caption = sprintf('The result for this graph is %.3f', mx1);
title(caption, 'FontSize', 30);

その他の回答 (1 件)

Star Strider
Star Strider 2014 年 12 月 25 日

1 投票

Use sprintf:
mx1 = pi;
figure(1)
scatter(rand(10,1), rand(10,1))
grid
ttl = sprintf('Scatterplot For mx_1 = %.5f', mx1)
title(ttl)

カテゴリ

ヘルプ センター および File Exchange2-D and 3-D Plots についてさらに検索

質問済み:

AA
2014 年 12 月 25 日

回答済み:

2014 年 12 月 25 日

Community Treasure Hunt

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

Start Hunting!

Translated by