matlab输出语句有两种,分别是:1、自由格式,语法如“disp(23+454-29*4)”;2、格式化输出,语法如“fprintf('the area is %8.5f\n',area)”。

MATLAB的输入与输出语句
1.MATLAB的输入语句input函数用于接收用户的输入:
a.输入数据
本文档主要讲述的是MATLAB与VB混合编程技术研究;着重探讨了在VB应用程序中集成MATLAB实现程序优化的四种方法,即利用Matrix VB、调用DLL动态链接库、应用Active自动化技术和动态数据交换技术,并分析了集成过程中的关键问题及其基本步骤。这种混合编程实现了VB的可视化界面与MATLAB强大的数值分析能力的结合。希望本文档会给有需要的朋友带来帮助;感兴趣的朋友可以过来看看
>> 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
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
>>










