MATLAB SHORT TUTORIAL:
By. Cynthia Furse
For Use in Assignments associated with ECE 3170, 6130, 6170
Where to Find Matlab at USU:
- Student PC Lab
- Microwave Lab PCs (EL208)
- SUN Lab
How to Run Matlab:
- From the PCs: Check the Programs Menu under Startup for Matlab. IF you do not find it, use "EDIT-FIND" to locate matlab.
- Begin program execution.
Basic File Handling:
- Matlab can create and use executable programs, similar to FORTRAN or C. They are stored in "M-files" (and have a file extension *.m).
- To create a new M-file (write a new program).
- Click "FILE-NEW-MFILE" on the Matlab menu.
- A blank M-file screen will appear. Begin typing your program.
- See the m-file attached to this tutorial for a description of many of the useful matlab commands. tutorial.m (Download this and place it in /matlab/bin)
- To store an m-file, click "FILE-SAVE" or "FILE-SAVEAS". The default storage location is /matlab/bin. You can also make subdirectories, and save files in these subdirectories.
To run an M-File:
- Be sure the file is saved in the way you want it to run (save after every change)
- Go to the main matlab window and type the name of the matlab M-FILE (type "tutorial").
Running Matlab directly from the matlab main window:
You can also execute matlab commands directly on the matlab main menu without writing an m-file. This is fine for short calculations.
Good Luck!
Please let me know what other critical elements you think need to be added to this tutorial.
And here are some student requests:
1. How to make a movie movie.m (Mathcad command is "animate")
2. How to make a circle really plot out as a circle: axis equal