Matlab基本函数-format函数
来源:互联网 发布:sas软件是什么 编辑:程序博客网 时间:2024/04/30 18:23
1、format函数:控制输出、显示格式
2、用法说明
format 缺省格式,同short。Matlab中常用的显示格式有:
(1)format short表示5位近似定点数
(2)format long 15位近似定点数
(3)format hex 十六进制表示
(4)format bank 银行格式,固定元和分
(5)format rat 最小证书比例(分数)表示
3、用法举例
>> pians = 3.1416>> format>> pians = 3.1416>> format short>> pians = 3.1416>> format long >> pians = 3.141592653589793>> format hex>> pians = 400921fb54442d18>> format bank>> pians = 3.14>> format rat>> pians = 355/1134、附录
>> help format format Set output format. format with no inputs sets the output format to the default appropriate for the class of the variable. For float variables, the default is format SHORT. format does not affect how MATLAB computations are done. Computations on float variables, namely single or double, are done in appropriate floating point precision, no matter how those variables are displayed. Computations on integer variables are done natively in integer. Integer variables are always displayed to the appropriate number of digits for the class, for example, 3 digits to display the INT8 range -128:127. format SHORT and LONG do not affect the display of integer variables. format may be used to switch between different output display formats of all float variables as follows: format SHORT Scaled fixed point format with 5 digits. format LONG Scaled fixed point format with 15 digits for double and 7 digits for single. format SHORTE Floating point format with 5 digits. format LONGE Floating point format with 15 digits for double and 7 digits for single. format SHORTG Best of fixed or floating point format with 5 digits. format LONGG Best of fixed or floating point format with 15 digits for double and 7 digits for single. format SHORTENG Engineering format that has at least 5 digits and a power that is a multiple of three format LONGENG Engineering format that has exactly 16 significant digits and a power that is a multiple of three. format may be used to switch between different output display formats of all numeric variables as follows: format HEX 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. Numbers with a large numerator or large denominator are replaced by *. format may be used to affect the spacing in the display of all variables as follows: format COMPACT Suppresses extra line-feeds. format LOOSE Puts the extra line-feeds back in. Example: format short, pi, single(pi) displays both double and single pi with 5 digits as 3.1416 while format long, pi, single(pi) displays pi as 3.141592653589793 and single(pi) as 3.1415927. format, intmax('uint64'), realmax shows these values as 18446744073709551615 and 1.7977e+308 while format hex, intmax('uint64'), realmax shows them as ffffffffffffffff and 7fefffffffffffff respectively. The HEX display corresponds to the internal representation of the value and is not the same as the hexadecimal notation in the C programming language. See also disp, display, isnumeric, isfloat, isinteger. Reference page in Help browser doc format
- Matlab基本函数-format函数
- matlab常用函数之format函数
- Matlab基本函数-ceil函数
- Matlab基本函数-colormap函数
- Matlab基本函数-compass函数
- Matlab基本函数-complex函数
- Matlab基本函数-conj函数
- Matlab基本函数-contrast函数
- Matlab基本函数-cylinder函数
- Matlab基本函数-disp函数
- Matlab基本函数-exp函数
- Matlab基本函数-expm函数
- Matlab基本函数-feather函数
- Matlab基本函数-fix函数
- Matlab基本函数-floor函数
- Matlab基本函数-ginput函数
- Matlab基本函数-hidden函数
- Matlab基本函数-imag函数
- ARP协议(转)
- Using the Runtime APIs
- 以太网(802.3)帧结构 (转)
- C++必知必会之(2)多态
- 自己配置了一天的opencv 从自带的库到编译成功的库写
- Matlab基本函数-format函数
- Node.js 异步式 I/O 与事件驱动
- Linux系统相关-----gcc编译参数
- SIFT之三:生成描述子
- win10下硬盘安装ubuntu16.04(一定能成功安装)
- Linux命令-----grep不查找隐藏文件夹的方法
- 配置IGMP Snooping
- kalloc.c
- Linux压缩包简体中文乱码终极解决方案