Next: Comparing efficiency of Up: No Title Previous: Text stringserror

Managing M-files

While using MATLAB one frequently wishes to create or edit an M-file and then return to MATLAB. One wishes to keep MATLAB active while editing a file since otherwise all variables would be lost upon exiting.

This can be easily done using the !-feature. If, while in MATLAB, you precede it with an !, any system command-such as those for editing, printing, or copying a file-can be executed without exiting MATLAB. If, for example, the system command ed accesses your editor, the MATLAB command

>>  !ed  rotate.m
will let you edit the file named rotate.m using your local editor. Upon leaving the editor, you will be returned to MATLAB just where you left it.

As noted in section 1, on systems permitting multiple processes, such as one running Unix, it may be preferable to keep both MATLAB and your local editor active, keeping one process suspended while working in the other. If these processes can be run in multiple windows, as on a workstation, you will want to keep MATLAB active in one window and your editor active in another.

You may consult your instructor or your local computing center for details of the local installation.

Version 4.0 has many debbugging tools. See help dbtype and references given there.

When in MATLAB, the command dir will list the contents of the current directory while the command what will list only the M-files in the directory. The MATLAB commands delete and type can be used to delete a diskfile and print a file to the screen, respectively, and chdir can be used to change the working directory. While these commands may duplicate system commands, they avoid the use of an !.

M-files must be accessible to MATLAB. On most mainframe or workstation network installations, personal M-files which are stored in a subdirectory of one's home directory named matlab will be accessible to MATLAB from any directory in which one is working. See the discussion of MATLABPATH in the User's Guide for further information.

Next: Comparing efficiency of Up: No Title Previous: Text stringserror

Wed Mar 13 19:15:55 MET 1996