要在句子中输入数值吗? x=input (pleaseinputanumber : ) )
please input a number:22
x=22
输入字符串? x=input (pleaseinputastring :s ) )
pleaseinputastring 3360 this isa string
x=this is a string
输出语句输出显示命令自由格式(disp? disp(23454-29*4) ) )
361
? disp([112233; 44 55 66; 77 88 99] )
11 22 33
44 55 66
77 88 99
? DISP(thisisastring ) )
this is a string
格式化输出(fprintf )。 请注意,frintf(theareais%8.5f(n ),area ) %输出格式前必须有%符号。
%跳过符号需要符号
The area is12.56637 %输出值为8位,包含5位小数
如果在这里学习过c语言的话就能很好地理解了。
错误信息显示命令? 错误(thisisanerror ) )
? this is an error
资料来源: http://cs.nju.edu.cn/cdx te/DCC 2003.files/MATLAB/MATLAB/8.htm