next up previous
Next: Visualizing wave equation solutions Up: Waves Previous: Dressing up your plots

Reading and writing external files

Because you may want to read MATLAB commands in from a file, rather than enter them all interactively, MATLAB allows the use of script files, also called M-files. They are called M-files because a .m ends the filename. To create such a file use the NEW M-FILE command under the FILE pull down window. A window is then created in which you can type MATLAB commands for later execution. You can save the file and execute it by using the SAVE AND EXECUTE command under the FILE pull down menu. This command only appears under the FILE pull down menu if the M-file window is the active window. (You click on a window to make it active.)

MATLAB can also read external ASCII data files that end with the characters .m . This is the easy way to get data from some experiment or test measurement into MATLAB. We will be doing some of this in later units and courses.



VICTOR W SPARROW
Tue Feb 25 21:24:33 EST 1997