Instant Help for Assignments
Lab 1: An incomplete list of functions you may need for your lab session assignment: plot, subplot, min, max, title, legend, hold on, hold off, dlmread
Lab 3: a. to generate an array with the equal gap k, and starting from s to t, use the command "a = s:k:t;". For example, try
a = 1:3:8; % a = [1 4 7];
b. to add annotation to a plot, you can use "text" command, or use menu insert->textbox or text arrow of the figure window.
c. to find the index of an element (or multiple elements) in an array that satisfies certain condition, use "find" command. For example,
a = [1 3 4 5];
i = find( a==1 ); % i = 1, meaning the first element in array a is equal to 1
j = find( a> 3 ); % j = [3 4], meaning the 3rd and 4th elements in a are larger than 3
Prob 5:
1. due to the size of data you are dealing with, you may encounter the "out of memory" problem while you use Matlab. No need to panic.
a. If you are using Matlab in Linux, try command "pack". Also, use "clear" to delete the variables you don't need anymore. If these do not help, after you clear up un-used variables, type "save", and exit from Matlab. Then start Matlab again, type "load". All the variables in the previous workspace will be loaded.
b. If you are using Matlab in Windows, no good to try "pack". Just clear up un-used variables, type "save", quit, restart, and then "load". Also, while you exit from Matlab, use Windows Task Manager to check if there are other applications/processes using up a lot of memory, and if you can close them.
2. For available analysis functions provided by Matlab, check:
a. MATLAB -> Functions -By Category -> Data Analysis
b. Statistics Toolbox -> Functions -By Category
You can type "doc" to get the help winodw, and use Help Navigator column to find the above function lists.
Access matlab from linux:
type /projects/matlab/bin/matlab or /projects/matlabR2006/bin/matlab to launch the program. Note the version you use should be 7.3. You can type command "ver" at any time for version information.
Type your commands in command window( menu Desktop -> Command Window). Edit your code in the editor window ( Desktop -> Editor ).
NOTE: We have about 20 floating license for matlab. Avoid waiting until the last minute to do your homework. But if you are running late yet unable to grasp a license, try to see if the oder versions work. The available versions of matlab are all under /projects. Please let TA know before the submission deadline that you have difficult to run Matlab.
Matlab tutorial:
Type "matlab tutorials" in google, you'll find more than enough links. A few suggestions:
1. The best one probably is by MathWorks.com (the maker of Matlab):
http://www.mathworks.com/academia/student_center/tutorials/launchpad.html
2. tutorial 1&2 in http://www.math.siu.edu/matlab/tutorials.html
3. the most important command you'll need: "doc". For example, type "doc plot", the help window will turn to the help page for the function "plot".
4. Don't hesitate to ask questions to your TAs.
matlab, quit, whos, help cmd, doc help, reshape, max, min, zeros,
ones, size, length, figure, plot, subplot, xlabel, ylabel, title, legend,
dlmread, clear, clc, save, load
More about plot & graph
here.