matlab各数据类型的区别

如题所述

第1个回答  推荐于2016-01-10
格式 中文解释 说明
format 短格式
(缺省格式) Default. Same as SHORT
format short 短格式
(缺省格式) Scaled fixed point format with 5 digits
(只显示五位十进制数)
format long 长格式 Scaled fixed point format with 15 digits
format short e 短格式e方式 Floating point format with 5 digits
format long e 长格式e方式 Floating point format with 15 digits
format short g 短格式g方式 Best of fixed or floating point format with 5 digits
format long g 长格式g方式 Best of fixed or floating point format with 15 digits
format hex 16进制格式 Hexadecimal format
format + +格式 The symbols +, - and blank are printed for positive, negative and zero elements. Imaginary parts are ignored
format bank 银行格式 Fixed format for dollars and cents
format rat 有理数格式 Approximation by ratio of small integers
format compact 压缩格式 Suppress extra line-feeds
format loose 自由格式 Puts the extra line-feeds back in
例如:
x=[4/3 1.2345e-6]
在不同的输出格式下的结果为:
短格式 1.3333 0.0000
短格式e方式 1.3333e+000 1.234e-006
长格式 1.333333333333333 0.000001234500000
长格式e方式 1.333333333333333e-000 1.23450000000000e-006
有理数格式 4/3 1/810045
16进制格式 3ff5555555555555 3eb4b6231abfd271
+格式 + +
对于短格式,如果矩阵的最大元素比数999999999大,或者比数0.0001小,则在打印时,将加入一个普通的长度因数.如y=1.e20*x,意为x被1020乘,结果为:
y=
1.0e+020*
1.3333 0.0000
“+”格式是显示大矩阵的一种紧凑方法,“+”,“-”和空格显示正数、负数和零元素.
最后format compact命令压缩显示的矩阵,以允许更多的信息显示在屏幕上.
§
相似回答