Octave load: Difference between revisions

298 bytes added ,  17 June 2013
no edit summary
No edit summary
No edit summary
Line 3: Line 3:
An example of how to load data from a file in Octave's ascii format can be found in this page [[fortran|page]].
An example of how to load data from a file in Octave's ascii format can be found in this page [[fortran|page]].


{{Code|octave_file_io.cc: C++ function to load a matrix from a BINARY file in Octave native format|<syntaxhighlight lang="C" style="font-size:13px">
{{Code|octave_binary_io_example.cc: C++ function to load a matrix from a BINARY file in Octave native format|<syntaxhighlight lang="C" style="font-size:13px">


#include <fstream>
#include <fstream>
Line 51: Line 51:


}
}
</syntaxhighlight>}}
To test, type the following in Octave:
{{Code|octave_binary_io_example.cc: C++ function to load a matrix from a BINARY file in Octave native format|<syntaxhighlight lang="Octave" style="font-size:13px">
>> test_var = randn(5);
>> save -binary test.bin test_var




</syntaxhighlight>}}
</syntaxhighlight>}}
Anonymous user