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...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 16: Input and Output 10916 Input and OutputThere are two distinct classes of input and output functions. The first set are modeledafter the functions available in Matlab. The second set are modeled after the standardI/O library used by the C programming language and offer more flexibility and control overthe output.When running interactively, <strong>Octave</strong> normally sends any output intended for your terminalthat is more than one screen long to a paging program, such as less or more. Thisavoids the problem of having a large volume of output stream by before you can read it.With less (and some versions of more) you can also scan forward and backward, and searchfor specific items.Normally, no output is displayed by the <strong>page</strong>r until just before <strong>Octave</strong> is ready to printthe top level prompt, or read from the standard input (for example, by using the fscanf orscanf functions). This means that there may be some delay before any output appears onyour screen if you have asked <strong>Octave</strong> to perform a significant amount of work with a singlecommand statement. The function fflush may be used to force output to be sent to the<strong>page</strong>r (or any other stream) immediately.You can select the program to run as the <strong>page</strong>r by setting the variable PAGER, and youcan turn paging off by setting the value of the variable <strong>page</strong>_screen_output to 0.moreCommandmore onCommandmore offCommandTurn output pagination on or off. Without an argument, more toggles the currentstate.PAGERBuilt-in VariableThe default value is normally "less", "more", or "pg", depending on what programsare installed on your system. See Appendix C [Installation], <strong>page</strong> 329.When running interactively, <strong>Octave</strong> sends any output intended for your terminal thatis more than one screen long to the program named by the value of the variable PAGER.<strong>page</strong> screen outputBuilt-in VariableIf the value of <strong>page</strong>_screen_output is nonzero, all output intended for the screen thatis longer than one <strong>page</strong> is sent through a <strong>page</strong>r. This allows you to view one screenfulat a time. Some <strong>page</strong>rs (such as less—see Appendix C [Installation], <strong>page</strong> 329) arealso capable of moving backward on the output. The default value is 1.<strong>page</strong> output immediatelyBuilt-in VariableIf the value of <strong>page</strong>_output_immediately is nonzero, <strong>Octave</strong> sends output to the<strong>page</strong>r as soon as it is available. Otherwise, <strong>Octave</strong> buffers its output and waits untiljust before the prompt is printed to flush it to the <strong>page</strong>r. The default value is 0.

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

Saved successfully!

Ooh no, something went wrong!