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 117The load command can read data stored in <strong>Octave</strong>’s text and binary formats, andMatlab’s binary format. It will automatically detect the type of file and do conversionfrom different floating point formats (currently only IEEE big and little endian,though other formats may added in the future).Valid options for load are listed in the following table.-force-ascii-binaryThe ‘-force’ option is accepted but ignored for backward compatiability.<strong>Octave</strong> now overwrites variables currently in memeory with the samename as those found in the file.Force <strong>Octave</strong> to assume the file is in <strong>Octave</strong>’s text format.WARNING: the meaning of this option will change in a future versionof <strong>Octave</strong> to be compatible with Matlab. To keep the meaning of yourcode the same across this change, use the -text option instead.Force <strong>Octave</strong> to assume the file is in <strong>Octave</strong>’s binary format.-mat-mat-binaryForce <strong>Octave</strong> to assume the file is in Matlab’s version 6 binary format.-V4-v4-4-mat4-binaryForce <strong>Octave</strong> to assume the file is in the binary format written by Matlabversion 4.-hdf5 Force <strong>Octave</strong> to assume the file is in HDF5 format. (HDF5 is a free,portable binary format developed by the National Center for SupercomputingApplications at the University of Illinois.) Note that <strong>Octave</strong> canread HDF5 files not created by itself, but may skip some datasets informats that it cannot support.HDF5 load and save are not available, as this <strong>Octave</strong> executable was notlinked with the HDF5 library.-import-textThe ‘-import’ is accepted but ignored for backward compatiability. <strong>Octave</strong>can now support multi-dimensional HDF data and automaticallymodifies variable names if they are invalid <strong>Octave</strong> identifiers.Force <strong>Octave</strong> to assume the file is in <strong>Octave</strong>’s text format.16.2 C-Style I/O Functions<strong>Octave</strong>’s C-style input and output functions provide most of the functionality of the Cprogramming language’s standard I/O library. The argument lists for some of the inputfunctions are slightly different, however, because <strong>Octave</strong> has no way of passing argumentsby reference.In the following, file refers to a file name and fid refers to an integer file number, asreturned by fopen.

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

Saved successfully!

Ooh no, something went wrong!