12.07.2015 Views

GNU Octave - Local Sector 7 web page

GNU Octave - Local Sector 7 web page

GNU Octave - Local Sector 7 web page

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Chapter 16: Input and Output 111format optionsCommandControl the format of the output produced by disp and <strong>Octave</strong>’s normal echoingmechanism. Valid options are listed in the following table.shortlonglong eshort elong Eshort Elong gshort g<strong>Octave</strong> will try to print numbers with at least 5 significant figures withina field that is a maximum of 10 characters wide (not counting additionalspacing that is added between columns of a matrix).If <strong>Octave</strong> is unable to format a matrix so that columns line up on thedecimal point and all the numbers fit within the maximum field width, itswitches to an ‘e’ format.<strong>Octave</strong> will try to print numbers with at least 15 significant figures withina field that is a maximum of 20 characters wide (not counting additionalspacing that is added between columns of a matrix).As will the ‘short’ format, <strong>Octave</strong> will switch to an ‘e’ format if it isunable to format a matrix so that columns line up on the decimal pointand all the numbers fit within the maximum field width.The same as ‘format long’ or ‘format short’ but always display outputwith an ‘e’ format. For example, with the ‘short e’ format, pi isdisplayed as 3.14e+00.The same as ‘format long e’ or ‘format short e’ but always display outputwith an uppercase ‘E’ format. For example, with the ‘long E’ format,pi is displayed as 3.14159265358979E+00.Choose between normal ‘long’ (or ‘short’) and and ‘long e’ (or ‘shorte’) formats based on the magnitude of the number. For example, withthe ‘short g’ format, pi .^ [2; 4; 8; 16; 32] is displayed asans =3.14169.869697.4099488.59.0032e+078.1058e+15long Gshort GThe same as ‘format long g’ or ‘format short g’ but use an uppercase‘E’ format. For example, with the ‘short G’ format, pi .^ [2; 4; 8; 16;32] is displayed as

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!