Recitation 1
Purpose
a)
Learn how to use MATLAB desktop and its various windows (command, workspace, etc.)
b)
Learn how to get help (helpdesk, doc, etc.)
Problems (Note, remember to get help from Matlab, when you meet difficulties.)
1.
Use Matlab to calculate the following problems.
a)
(5^2)/(4833)
b)
3
7
5
2
+
2.
Create a bunch of variables (some with decimals, some with character arrays).
a = ‘hello’;
A = 27;
% Variable names are case sensitive, so variable A is different from a.
b = ‘m’;
x = 15;
x = x + 1;
% Now, what is the value of x?
y = 22.45;
d = x + y;
variable1 = 2 + 3i;
% complex number
variable2 = 2 + 3 * y;
% Notice the difference
circumference = 2 * pi * r;
% Figure out why this does not work.
whos;
% What does the
whos
command tell you?
clear d;
% Delete variable d.
3.
row vector & column vector & cell array
a = 1 : 5;
% colon operator, also try 1 : 1 : 5
% How do you create the same vector a by using
linspace
? (Remember to get help from
Matlab.)
b = 1 : 0.2 : 5;
% row vector
What is the value of the 17
th
element of vector b?
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
This is the end of the preview.
Sign up
to
access the rest of the document.
 Fall '11
 YunJiang
 Dot Product, Row vector, Covariance and contravariance of vectors

Click to edit the document details