登录论坛

查看完整版本 : 刚接触Matlab没多久,有点问题想打扰一下。


jasonzou
2008-06-28, 22:24
想问一下matlab的输出格式有哪些。

我的感觉好像它不能输出浮点格式吧,不知道我有没有搞错。

%c Single character
%d Decimal notation (signed)
%e Exponential notation (using a lowercase e as in 3.1415e+00)
%E Exponential notation (using an uppercase E as in 3.1415E+00)
%f Fixed-point notation
%g The more compact of %e or %f, as defined in [2]. Insignificant zeros do not print
%G Same as %g, but using an uppercase E
%i Decimal notation (signed)
%oOctal notation (unsigned)
%s String of characters
%u Decimal notation (unsigned)
%x Hexadecimal notation (using lowercase letters a-f)
%X Hexadecimal notation (using uppercase letters A-F)
里面没有float格式的输出吧,不知道各位是怎么实现浮点输出的。
还有个问题,既然matlab可以按格式读入,它不能实现格式输出吗?才接触,可是很急用,感谢各位了。

fanxing39
2008-06-29, 02:33
MATLAB里 前面加“%”不算程序了,是注释行
输入命令是 fprint 你用 help 查下,里面有详细的说明

jasonzou
2008-06-29, 16:31
回二楼的朋友,是fprintf吧,我在help里查了下,
那些%后面跟的就是输出格式的参数设置,关于它们的解释我也贴出来了,
我在里面看了下,没有浮点的定义吧,只有定点数的定义......
刚接触matlab,而且自己英语不太好,可能有什么地方我理解错了