Page 45 - Numerical Analysis Using MATLAB and Excel
P. 45

Chapter 1  Introduction to MATLAB


               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 Floating point format with 5 digits.
               FORMAT LONG E  Floating point format with 15 digits.
               FORMAT SHORT G Best of fixed or floating point
                              format with 5 digits.
               FORMAT LONG G  Best of fixed or floating point format
                              with 15 digits.
               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.

               Spacing:
               FORMAT COMPACT Suppress extra line-feeds.
               FORMAT LOOSE   Puts the extra line-feeds back in.
               Some examples with different format displays age given below.

               format short  33.3335  Four decimal digits (default)
               format long  33.33333333333334 16 digits

               format short e  3.3333e+01  Four decimal digits plus exponent

               format short g  33.333  Better of format short or format short e
               format bank  33.33 two decimal digits

               format +  only + or − or zero are printed

               format rat 100/3 rational approximation






















               1−32                             Numerical Analysis Using MATLAB® and Excel®, Third Edition
                                                                             Copyright © Orchard Publications
   40   41   42   43   44   45   46   47   48   49   50