Plot Title

3 次查看(过去 30 天)
James
James 2011-3-28
I want to give a plot a title that includes the value of a variable. For example, the tite of the plot might be "Disp V time for point at x=1.5"
I want the 1.5 to come from a variable...
can anyone help??
thanks

回答(1 个)

Friedrich
Friedrich 2011-3-28
Hi James,
I think you are looking for the num2str function. I have written a small example code:
a = 1.5;
plot(1:10);
title(['Text you like and than the value ',num2str(a)])

类别

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