Professional Documents
Culture Documents
E. Working With Programs
E. Working With Programs
E. Working With Programs
3. Save the file in the current directory as sample.m in the current directory.
4. In Command Window, you may run the saved script file by typing:
Note: A script file may be listed in the Command Window with the command type, e.g.
5. When you run a script, you have to make sure that Matlab’s current directory is set to the directory to
which the script is saved. To change directory, browse through the current directory or change from the
command line, e.g.
F. Capturing output
1. To capture output in Command Window, type