chapter 2_exersise1_..

advertisement
Last Name: ___________________________________ First Name: ______________________ (use capital letters only)
Please run these exercises individually at your own; write down your answers next to the questions, use arrows if needed.
Submit the answers to the TA’s as early as possible preferable not after the third class. Average time per question is 30
seconds. You may get credit as a quiz if all responses are correct and you prepare this form using a word processor. (The
word version of this exercise is in the website)
1)
2)
3)
4)
5)
6)
7)
8)
9)
10)
11)
12)
13)
14)
15)
16)
17)
18)
19)
20)
21)
22)
23)
24)
25)
26)
27)
28)
29)
30)
31)
32)
33)
34)
35)
36)
37)
38)
39)
40)
41)
42)
43)
44)
45)
X1 =
46)
47)
48)
49)
50)
51)
>> 55 - 16
>> 3/0
>> 0/3
>> 12345679*9
>> ans*18
>> ans/3
>> B = 6;
>> a = 4, A = 6; x = 1
>> a
>> A
>> B
>> x = 2 + i*4
>> x = 2 + j*4
>> pi
>> format long
>> pi
>> format short
>> pi
>> format short e
>> pi
>> format long e
>> pi
>> format short eng
>> pi
>> format short
>> a = [1 2 3 4 5]
b = a’
>> D = a*b
>> c = [2 4 6 8 10]’
>> a’
>> A = [ 1 2 3; 4 5 6; 7 8 9]
>> C = [[1 2 3]’ [4 5 6]’ [7 8 9]’]
>> D = a*b
>> F = b*a
>> who
>> whos
>> b(3)
>> A(3,2)
>> E = zeros(3,3)
>> y = ones(1,4)
>> z = ones (4,4)
>> t = 1:5
>> t = 1.5:0.5:3
>> t = 10:-1:5
>> A(2 , :)
>> t(2:4)
3; x2 = 7; n = 9
>> linspace(x1, x2, n)
>> linspace(0,1,6)
>> linspace(0,pi,7)
>> (180/pi)* linspace(0,pi,7)
>> logspace(-1,2,4)
>> logspace(-2,5,9)
52)
53)
54)
55)
6,
56)
57)
58)
59)
60)
61)
62)
63)
64)
65)
66)
67)
68)
69)
70)
71)
72)
73)
>>
>>
>>
>>
7,
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
f = ‘Miles ‘
s = ‘Davis ‘
x = [f,s]
a = [1 2 3 4 5 …
8]
%check ellipsis rule at the bottom of page 31
2*pi
y=pi/4
y^2.48
y = -4^2
y = (-4)^2
rr = 2^3^4
rr = (2^3)^4
rr = 2^(3^4)
zzzz = 3
zzzz = zzzz + 2
(5 + 7^2*3)/4 – 1
x = 2+4i
y = 16
3*x
1/x
x^2
x + y
a*b
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
b*a
help log
help elfun
log(A)
sqrt(A)
sqrtm(A)
E=[-1.6 -1.5 -1.4 1.4 1.5 1.6]
round(E)
ceil(E)
floor(E)
F=[3 5 4 6 1]
sum(F)
min(F)
max(F)
mean(F), prod(F), sort(F)
t = [0:2:20]
length(t)
g = 9.81
m = 68.1
cd = 0.25
v = sqrt(g*m/cd)*tanh(sqrt(g*cd/m)*t)
plot(t,v)
title(‘Plot of v versus T’)
xlabel(‘t’)
ylabel(‘v’)
grid
b = a’
74)
75)
76)
77)
78)
79)
80)
81)
82)
83)
84)
85)
86)
87)
88)
89)
90)
91)
92)
93)
94)
95)
96)
97)
98)
99)
Download