matlab输出语句有两种,分别是:1、自由格式,语法如“disp(23+454-29*4)”;2、格式化输出,语法如“fprintf('the area is %8.5f\n',area)”。
matlab的输入与输出语句
1.matlab的输入语句input函数用于接收用户的输入:
a.输入数据
>> x=input('please input a number:')please input a number:22x = 22
b.输入字符串
>> x=input('please input a string:','s')please input a string:this is a stringx =this is a string
2.matlab输出语句包括自由格式(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输出语句是什么的详细内容。