Escolar Documentos
Profissional Documentos
Cultura Documentos
,;
ans
a = [1 2 3 4 6 4 3 4 5]
a=
b=a+2
1
2
4
5
b=
3
6
plot(b)
grid on
bar(b)
xlabel('Sample #')
ylabel('Pounds')
plot(b,'*')
axis([0 10 0 10])
A = [1 2 0; 2 5 -1; 4 10
-1]
B = A'
C=A*B
X = inv(A)
I = inv(A) * A
C = A .* B
*****
A=
1
2
4
B=
2
0
5 -1
10 -1
1
2
0
C=
2
5
-1
4
10
-1
inverse of a matrix
5 12 24
12 30 59
24 59 117
X=
2
-1
-2
-2
1
1
identity matrix
5
-2
0
I=
1
0
0
C=
0
1
0
0
0
1
eig(A)
svd(A)
p = round(poly(A))
roots(p)
q = conv(p,p)
obtain eigenvalues
1
4
0
4 25 -10
0 -10
1
ans =
3.7321
0.2679
1.0000
ans =
12.3171
0.5149
0.1577
p=
1
-5
ans =
3.7321
1.0000
0.2679
q=
1 -10
r = conv(p,q)
plot(r);
-1
35 -52
35 -10
1
r=
1 -15 90 -278 480 -480
278 -90 15 -1
whos
Name
Size
Attributes
A=
A
B
C
I
X
a
ans
b
p
q
r
Bytes Class
3x3
3x3
3x3
3x3
3x3
1x9
3x1
1x9
1x4
1x7
1x10
72 double
72 double
72 double
72 double
72 double
72 double
24 double
72 double
32 double
56 double
80 double
1
2
0
2
5 -1
4 10 -1
ans =
sqrt(-1)
0 + 1.0000i
A = magic(3)
A=
8
3
1
5
6
7
B = 2*ones(3)
4
B=
2
2
2
A.*B
2
2
2
2
2
2
ans =
16
2
6 10
8 18
oooo
12
14
4
plot(Y,'ro')
title('Title name)
n=length(Y)
hold on
hold of
t = (1900:10:2000)'
Red circle
Legend()
stem(A)
axis square
axis of
axis on
axis equal
det(A)
trace(A)
poly(A)
=
1.0000 -15.0000 -18.0000
-0.0000
sqrtm(A)
A = pascal(3)
rand(3,3)
1
2
3
0.6771
0.5198
0.0768
chol(A)
1
3
6
0.0558
0.2587
0.4399
Cholesky Factorization
1
0
0
1
1
0
1
2
1
0.2843
0.6788
0.9496
[V,D] = eig(A)
V=
-0.5438 -0.8165
0.7812 -0.4082
-0.3065 0.4082
0.1938
0.4722
0.8599
D=
0.1270
0
0
0 1.0000
0
0
0 7.8730
GRAPHICS
x = [0:.2:20];
y=
y = sin(x)./sqrt(x+1);
y(2,:) =
sin(x/2)./sqrt(x+1);
y(3,:) = sin(x/3)./sqrt(x+1)
Columns 1 through 10
0.1814
0.0911
0.0608