MATLAB Summary
MATLAB (matrix algebra)
Matlab is a commercial "Matrix Laboratory" package which operates as an interactive programming environment. It is a mainstay of the Mathematics Department software lineup and is also available for PC's and Macintoshes and may be found on the CIRCA VAXes. Matlab is well adapted to numerical experiments since the underlying algorithms for Matlab's builtin functions and supplied m-files are based on the standard libraries LINPACK and EISPACK.Matlab program and script files always have filenames ending with ".m"; the programming language is exceptionally straightforward since almost every data object is assumed to be an array. Graphical output is available to supplement numerical results.
Online help is available from the Matlab prompt (a double arrow), both generally (listing all available commands):
>> help
[a long list of help topics follows]
and for specific commands:
>> help fft
[a help message on the fft function follows].
Paper documentation is on the document shelf in compact black books and locally generated tutorials are available and are used in courses.How to quit Matlab
The answer to the most popular question concerning any program is this: leave a Matlab session by typingquit
or by typingexit
to the Matlab prompt.Batch jobs
Matlab is most often used interactively, but "batch" or "background" jobs can be performed as well. Debug your commands interactively and store them in a file (`script.m', for example). To start a background session from your input file and to put the output and error messages into another file (`script.out', for example), enter this line at the system prompt:nice matlab < script.m >& script.out &
You can then do other work at the machine or logout while Matlab grinds out your program. Here's an explanation of the sequence of commands above.
- The "nice" command lowers matlab's priority so that interactive users have first crack at the CPU. You must do this for noninteractive Matlab sessions because of the load that number--crunching puts on the CPU.
- The "< script.m" means that input is to be read from the file script.m.
- The ">& script.out" is an instruction to send program output and error output to the file script.out. (It is important to include the first ampersand (&) so that error messages are sent to your file rather than to the screen -- if you omit the ampersand then your error messages may turn up on other people's screens and your popularity will plummet.)
- Finally, the concluding ampersand (&) puts the whole job into background.
A quick tutorial on Matlab is available in the next Info node in this file. (Touch the "n" key to go there now, or return to the menu in the Top node for this file.)
No comments:
Post a Comment