Documentos de Académico
Documentos de Profesional
Documentos de Cultura
(Las operaciones entre vectores se realizan elemento a elemento y deben tener el mismo
nmero de elementos)
10
16
14
>> v1-v2
ans =
-4
-2
-2
-2
>> v1.*v2
ans =
21
24
63
48
>> v1./v2
ans =
0.4286
0.6667
0.7778
0.7500
>> v1.^v2
ans =
2187
4096
40353607
1679616
2. Las operaciones con matrices deben seguir las reglas del lgebra matricial en cuanto a
la dimensin de las matrices con las que se va a operar:
determnate de m1
SOLUCION EN MATLAB
>> m1=[2 3 6; 3 4 7; 7 0 5]
m1 =
2
3
7
3
4
0
6
7
5
>> m2=rand(3,3)
m2 =
0.8147
0.9058
0.1270
0.9134
0.6324
0.0975
0.2785
0.5469
0.9575
3.9134
4.6324
0.0975
6.2785
7.5469
5.9575
>> m1+m2
ans =
2.8147
3.9058
7.1270
>> m1-m2
ans =
1.1853 2.0866
2.0942 3.3676
6.8730 -0.0975
5.7215
6.4531
4.0425
>> m1.*m2
ans =
1.6294
2.7174
0.8889
2.7401 1.6710
2.5294 3.8282
0 4.7875
>> m4=m2'
m4 =
0.8147
0.9134
0.2785
0.9058
0.6324
0.5469
0.1270
0.0975
0.9575
8.5
vector2
7.5
6.5
3.5
4.5
5
vector1
5.5
6.5
>> figure
plot([-5:5],rand(1,11),'ro-')
hold on
plot([-5:5],rand(1,11),'g*-')
plot([-5:5],rand(1,11),'bx-')
plot([-5:5],rand(1,11),'m+-')
hold off
1
0.9
0.8
0.7
0.6
0.5
0.4
0.3
0.2
0.1
0
-5
-4
-3
-2
-1
>> figure
plot([0:11],sin(linspace(-pi,pi,12)))
1
0.8
0.6
0.4
0.2
0
-0.2
-0.4
-0.6
-0.8
-1
10
12
>> figure
plot([0:11],cos(linspace(-pi,pi,12)))
axis([-1 12 -2 2])
2
1.5
1
0.5
0
-0.5
-1
-1.5
-2
>> figure
10
12
subplot(1,2,1)
plot([0:11],2*sin(linspace(-pi,pi,12)))
subplot(1,2,2)
plot([0:11],5*sin(linspace(-pi,pi,12)))
5
4
1.5
3
1
2
0.5
0
-1
-0.5
-2
-1
-3
-1.5
-2
-4
10
15
-5
10
15
>> y1=polyval(p,3)
y1 =
51
>> x=[0:10];
>> y=polyval(p,x);
>> plot(x,y)
1200
1000
800
600
400
200
10
B.
syms x
>> q= (sqrt (x+4))+7.*x+1
q=
7*x + (x + 4)^(1/2) + 1
>> yx1=subs(q,0)
yx1 =
3
>> ezplot(q,[0:10])
7 x + (x + 4)1/2 + 1
80
70
60
50
40
30
20
10
0
0
5
x
10
C.
>> syms x
>> r= 10.*sin(2.*x)+ (1/2).*(exp(x)^-x)
r=
10*sin(2*x) + 1/(2*exp(x)^x)
>> yx1=subs(r,2)
yx1 =
-7.5589
>> ezplot(r,[0:5])
10 sin(2 x) + 1/(2 exp(x)x )
10
-5
-10
0
0.5
1.5
2.5
x
3.5
4.5
A=
>> B=[4 2 1 ; 1 6 8]
B=
>> C=[1 2 4 ]
C=
>> D=A*B
D=
27
52
61
17
14
12
12
>> syms t
>> H=C.*D^t
H=
[matrix([[27, 52, 61], [17, 14, 12], [12, 6, 3]])^t, 2*matrix([[27, 52, 61], [17, 14, 12],
[12, 6, 3]])^t, 4*matrix([[27, 52, 61], [17, 14, 12], [12, 6, 3]])^t]
Q=
[ matrix([[27, 52, 61], [17, 14, 12], [12, 6, 3]])^t/150, matrix([[27, 52, 61], [17,
14, 12], [12, 6, 3]])^t/75, (2*matrix([[27, 52, 61], [17, 14, 12], [12, 6,
3]])^t)/75]
7. De la siguiente expresin.