disp的用法
在matlab中help disp
DISP Display array.
DISP(X) displays the array, without printing the array name. In
all other ways it's the same as leaving the semicolon off an
expression except that empty arrays don't display.
If X is a string, the text is displayed.
意思是输出数组类型的数据,也可以把string类型的数据看做数组输出
(1)输出数字
>> num = 1;
>> disp(num)
1
(2)输出字符串
>> disp('this is string')
this is string
>>
(3)输出数字和字符串
>> num = 1;
>> disp(['num:',num2str(num)])
num:1
(4)输出数组
>> a=[1 2 3];
>> disp(a)
1 2 3
最后
以上就是害怕羊最近收集整理的关于matlab中disp函数的简单用法的全部内容,更多相关matlab中disp函数内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复