天天看點

matlab中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等中此用法類似

**********************************************************

#end

繼續閱讀