转载自:https://blog.csdn.net/ldj1208/article/details/51445835
https://blog.csdn.net/lingyunxianhe/article/details/80469347
在title中放入多个变量的值的方法
1. 三行标题
a= 1; b= 2; c = 3; d= 4;
title( { 'Plot', ['a = ', num2str(a), 'b = ',num2str(b)], ['c = ', num2str(c),',d = ',...
num2str(d) ] } )
Notice:有两点,一是title中引入中括号[ ],每对中括号表示一行;二是多行[ ]用{ }括起来
2.两行标题
a = 1; b = 2; c = 3; d =4;
title( { 'Plot', ['a = ', num2str(a), ',b = ',num2str(b), ...
',c = ', num2str(c),', d= ',num2str(d) ] } )
**********************************************************
xlabel,ylabel,text,legend等中此用法类似
**********************************************************
使用title函数正确显示带有下划线的字符串,示例如下:
-
figure
-
plot((1:10).^2)
-
title('X_1','Interpreter','none')