matlab中disp函数的简单用法

输出数组类型的数据,也可以把string类型的数据看做数组输出

  • 输出数字
>> num = 1;
>> disp(num)
     1
  • 输出字符串
>> disp('this is string')
this is string
>> 
  • 输出数字和字符串
>> num = 1;
>> disp(['num:',num2str(num)])
num:1
  • 输出数组
>> a=[1 2 3];
>> disp(a)
     1     2     3

参考:https://blog.csdn.net/m0_38037810/article/details/78674287

猜你喜欢

转载自www.cnblogs.com/Terrypython/p/9497174.html