Getting Started Previous page   Next Page

The load Function

The load function reads binary files containing matrices generated by earlier MATLAB sessions, or reads text files containing numeric data. The text file should be organized as a rectangular table of numbers, separated by blanks, with one row per line, and an equal number of elements in each row. For example, outside of MATLAB, create a text file containing these four lines:

Store the file under the name magik.dat. Then the statement

reads the file and creates a variable, magik, containing our example matrix.

An easy way to read data into MATLAB in many text or binary formats is to use Import Wizard.


Previous page  Working with Matrices M-Files Next page

© 1994-2005 The MathWorks, Inc.