Frequently Asked Questions (FAQ's)
How do I start Matlab?
- If you are in Blocker 131 (class), there is an icon on the bottom of the
screen which will start up a local session of matlab.
- If you are in one of the open access labs, login using your Open
Access Labs user name and password. Then execute
Start -> Programs -> Communications -> X-win
Open the Sessions menu, and select Calclab1
- If you are off campus, or in a dorm, you must either have a copy of
Matlab (Student or Regular edition), or a high speed network connection
and XWindows.
How do I download files from the Web?
Right-Mouse-Click on the link, and select "Save Link As" option. A file
dialog box will open, and save the file in the directory you wish.
Shift-Left-Mouse-Click is a shortcut which will sometimes work.
How do I load a file into Matlab?
If you download a Matlab m-file (ending with a .m extension)
use the commands (in the Matlab command window)
- pwd - print working directory,
- cd - change directory, and
- dir - show files in directoy
to get to the location where you saved the files.
To run an m-file, type the name of
the file (without the .m extension) in the command window.
Matlab m-files are, for the most part, ascii files which can be viewed
an edited. By the way, this is a good way to learn Matlab functions and
programming!
How do I plot (2d) a function in Matlab?
The easiest way is the following:
- Decide how many points you want on the interval, (a,b). Then
set up an array of x values by
>> x = linspace(a,b,N);
This means "divide up the interval (a,b) into N equally spaced sub
intervales".
- Apply your function
>> y = f(x);
- Now plot
>> plot(x,y)
- Once the plot window opens, you can edit the plot. You can also
print the plot, and export it in various formats