This preview shows pages 1–3. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: 6/6/10 8:32 PM Matlab Summary and Tutorial Page 1 of 29 http://www.math.ufl.edu/help/matlabtutorial/matlabtutorial.html 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 mfiles 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 typing quit or by typing exit 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 & 6/6/10 8:32 PM Matlab Summary and Tutorial Page 2 of 29 http://www.math.ufl.edu/help/matlabtutorial/matlabtutorial.html 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. 1. 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 numbercrunching puts on the CPU. 2. The "< script.m" means that input is to be read from the file script.m. 3. 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.) 4. Finally, the concluding ampersand (&) puts the whole job into background....
View
Full
Document
This note was uploaded on 11/14/2011 for the course ECE 3820 taught by Professor Wang during the Fall '11 term at GWU.
 Fall '11
 Wang

Click to edit the document details