Getting Started Previous page   Next Page

M-Files

You can create your own matrices using M-files, which are text files containing MATLAB code. Use the MATLAB Editor or another text editor to create a file containing the same statements you would type at the MATLAB command line. Save the file under a name that ends in .m.

For example, create a file containing these five lines:

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

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


Previous page  The load Function Concatenation Next page

© 1994-2005 The MathWorks, Inc.