next up previous contents
Next: M-files Up: The Session Previous: Recording and Retrieving

Shell Escapes

MATLAB provides ways to deal with the shell from within MATLAB. pwd and cd give the current directory path, cd directory changes the current directory. dir and ls give a directory listing; what lists the M-files. type filename shows the contents of text file filename or filename.m. delete filename will remove the file -- it acts as the UNIX command ``rm,'' not the UNIX ``delete.'' To send an arbitrary command to your shell, prefix it with ``!'';

.1ex>> !emacs & will start up an emacs in the background just as from an athena prompt. This is frequently helpful for managing M-files (see gif M-files). The command
[status result] = unix('unix command string')
also executes an arbitrary command in the operating system, returning the command status (zero for success, nonzero for failure) and standard output.

Sat Mar 21 21:42:28 EST 1998