matlab两种输出语句分别是什么
发布时间:2021-02-26 14:21:27
来源:亿速云
阅读:79
作者:小新
MATLAB的输入与输出语句
的输入语句input函数用于接收用户的输入:
a.输入数据>> x=input('please input a number:')
please input a number:22
x =
22
b.输入字符串>> x=input('please input a string:','s')
please input a string:this is a string
x =
this is a string
输出语句包括*格式(disp)和格式化输出(fprintf)两种>> disp(23+454-29*4)
361
>> disp([11 22 33;44 55 66;77 88 99])
11 22 33
44 55 66
77 88 99
>> disp('this is a string')
this is a string
>> area=12.56637889;
>> fprintf('The area is %8.5f\n',area)
The area is 12.56638
>>
感谢你能够认真阅读完这篇文章,希望小编分享的“matlab两种输出语句分别是什么”这篇文章对大家有帮助,同时也希望大家多多支持亿速云,关注亿速云行业资讯频道,更多相关知识等着你来学习!