Академический Документы
Профессиональный Документы
Культура Документы
Laboratorio
Mtodos
Numricos
2013
APELLIDOS Y
NOMBRES:
YAGUA
HUAMAYALLI,
JUAN JOSE
Directorio actual, rea en la cual es exhibida la lista de los archivos y directorios contenidos en el directorio
actual.
2.
>> dir
.
extern
license.txt
..
help
licenses
appdata
ja
notebook
bin
java
patents.txt
etc
lib
3.
resources
rtw
sys
toolbox
runtime
simulink
trademarks.txt
uninstall
4.
5.
6.
Duplicar los archivos de la carpeta COLOR que comiencen con m y tengan extensin m asignando
a los duplicados la letra inicial p y la extensin p.
METODOS NUMERICOS
>> diag(A)
ans =
2
1
3
>> det(A)
ans =
8
>> rank(A)
ans =
3
>> inv(A)
ans =
0.1250
0.6250 -0.5000
-0.6250 -0.1250
1.5000
METODOS NUMERICOS
A=
2
>> B=diag(A)
B=
2
1
3
>> C=diag(fliplr(A))
C=
7
1
1
>> D=[B,C]
D=
2
METODOS NUMERICOS
CAPITULO 3
-4
-2
-7
14
>> B=[3;0;2]
B=
3
0
2
>> X=A\B
X=
1.1967
0.8361
0.4754
METODOS NUMERICOS
-1
-1
-1
-1
-1
>> B=[4;1;-3;4]
B=
4
1
-3
4
>> X=A\B
X=
-1.0000
2.0000
-0.0000
1.0000
METODOS NUMERICOS
-1
-5
METODOS NUMERICOS
3.0000
2.0000
0.5000
6.0000
2.0000
5.0000 -3.0000
1.0000
2.0000
>> X=B\b1
X=
0.8333
METODOS NUMERICOS
METODOS NUMERICOS
>> [L,U]=lu(A)
L=
1.0000
1.0000
0.6667
0.8000 0.5000
1.0000
1.0000
0.6667
1.0000
1.0000
1.0000
0.6667
0
0
0.6000
1.0000
U=
1.0000
1.0000
1.0000 1.0000
3.0000
1.0000
1.0000
2.0000
4.4667
0 3.5000
>> [L,U,P]=lu(A)
L=
1.0000
1.0000
1.0000
1.0000
0.6667
1.0000
0.6667
1.0000
0
0
0.6000
0
0
1.0000
0.6667
0.8000 0.5000
1.0000
1.0000
1.0000 1.0000
1.0000
U=
1.0000
0
3.0000
1.0000
2.0000
4.4667
0 3.5000
METODOS NUMERICOS
P=
1
>> [Q,R]=qr(A)
Q=
-0.5000
0.5916
0.1280
0.4907
0.3780
0.2590 -0.7559
0.3780
-0.5000 -0.4226
0.0000
0.7314 -0.1908
0 -0.6761 -0.2377
0.5861
0.3780
R=
-2.0000 -5.5000 -6.5000 -3.5000 -6.0000
0
2.6714
4.1026
0 -2.6458
>> Q*R
ans =
1.0000
1.0000
1.0000 1.0000
1.0000
1.0000
3.0000
5.0000 3.0000
7.0000
1.0000
3.0000
6.0000 1.0000
1.0000
1.0000
4.0000
1.0000 2.0000
3.0000
2.0000
3.0000
5.0000
METODOS NUMERICOS
4.0000
10
>> A
A=
1
>> A(3,:)=A(3,:)-A(1,:)
A=
1
>> A(4,:)=A(4,:)-A(1,:)
METODOS NUMERICOS
11
A=
1
CAPITULO 4
6. Evaluar los polinomios en x = 1:0.3:7
i.
ii.
P3=x10+ x+ 1
En Matlab:
i)
>> p2=[2,0,0,0,3i,6-2i];
>> x=1:0.3:7;
>> polyval(p2,x)
ans =
1.0e+004 *
Columns 1 through 2
0.0008 + 0.0001i 0.0013 + 0.0002i
Columns 3 through 4
0.0027 + 0.0003i 0.0056 + 0.0004i
Columns 5 through 6
0.0109 + 0.0005i 0.0201 + 0.0006i
Columns 7 through 8
0.0350 + 0.0006i 0.0579 + 0.0007i
Columns 9 through 10
METODOS NUMERICOS
12
Columns 11 through 12
0.2054 + 0.0010i 0.2946 + 0.0011i
Columns 13 through 14
0.4125 + 0.0012i 0.5656 + 0.0013i
Columns 15 through 16
0.7610 + 0.0014i 1.0072 + 0.0014i
Columns 17 through 18
1.3133 + 0.0015i 1.6898 + 0.0016i
Columns 19 through 20
2.1481 + 0.0017i 2.7009 + 0.0018i
Column 21
3.3620 + 0.0019i
ii)
>> p3=[1,0,0,0,0,0,0,0,0,1,1];
>> x=1:0.3:7;
>> polyval(p3,x)
ans =
1.0e+008 *
Columns 1 through 4
0.0000
0.0000
0.0000 0.0000
Columns 5 through 8
0.0000
0.0001
0.0003 0.0008
Columns 9 through 12
0.0021
0.0048
0.0105 0.0216
Columns 13 through 16
0.0424
0.0798
0.1446 0.2533
Columns 17 through 20
METODOS NUMERICOS
13
0.7133
1.1529 1.8228
Column 21
2.8248
7. Hallar el desarrollo del trinomio p(x) =( x3 - ix+2)4 usando los comandos de Matlab
En Matlab:
>> p=[1 0 -i 2];
>> q=conv(p,p)
q=
Columns 1 through 4
1.0000
0 - 2.0000i 4.0000
Columns 5 through 7
-1.0000
0 - 4.0000i 4.0000
>> r=conv(q,p)
r=
Columns 1 through 4
1.0000
0 - 3.0000i 6.0000
Columns 5 through 8
-3.0000
Columns 9 through 10
0 -12.0000i 8.0000
>> conv(r,p)
ans =
METODOS NUMERICOS
14
0 - 4.0000i 8.0000
Columns 5 through 8
-6.0000
Columns 9 through 12
1.0000 -48.0000i 32.0000 + 8.0000i -24.0000
0 -32.0000i
Column 13
16.0000
9. Hallar el resto de la divisin de p(x) por d(x)= x3 - ix+2, siendo p(x) el polinomio
Caracterstico de la matriz A.
11111
13537
13611
14123
02345
A=
En Matlab:
>> A=[1,1,1,1,1;1,3,5,3,7;1,3,6,1,1;1,4,1,2,3;0,2,3,4,5]
A=
1
1
1
1
0
1
3
3
4
2
1
5
6
1
3
1
3
1
2
4
1
7
1
3
5
>> poly(A)
ans =
Columns 1 through 4
1.0000 -17.0000 47.0000 -4.0000
Columns 5 through 6
203.0000 -196.0000
>> P=poly(A);
>> [Q,R]=deconv(P,[1,0,-i,2])
METODOS NUMERICOS
15
Q=
Columns 1 through 2
1.0000
-17.0000
Column 3
47.0000 + 1.0000i
R=
1.0e+002 *
Columns 1 through 2
0
Columns 3 through 4
0
-0.0600 - 0.1700i
Columns 5 through 6
2.3600 + 0.4700i -2.9000 - 0.0200i
Columns 3 through 4
METODOS NUMERICOS
16
0 - 4.0000i
Columns 7 through 8
4.0000 - 1.0000i 6.0000
R=
Columns 1 through 2
0
Columns 3 through 4
0
Columns 5 through 6
0
Columns 7 through 8
0
Columns 9 through 10
1.0000 +12.0000i -7.0000 + 8.0000i
Column 11
-11.0000
>> D=polyder(Q)
D=
Columns 1 through 2
7.0000
Columns 3 through 4
0 + 5.0000i -8.0000
Columns 5 through 6
-3.0000
0 - 8.0000i
Column 7
4.0000 - 1.0000i
METODOS NUMERICOS
17
METODOS NUMERICOS
18
CAPITULO 5
1. 0 7.5
2. 5 4.0
3. 2 5.0
3. 5 5.5
2. 0 6.3
7. 8 6.2
8. 1 6.0
9. 7 5.0
10. 3 3.0
METODOS NUMERICOS
19
2. Graficar usando este archivo la 1ra columna versus la 2da columna a travs
de una poligonal lineal, use textread para leer los datos de este archivo.
>> textread('PREGUNTA1MATLAB.txt')
ans =
1.0000
7.5000
2.5000
4.0000
3.2000
5.0000
3.5000
5.5000
2.0000
6.3000
7.8000
6.2000
8.1000
6.0000
9.7000
5.000
10.3000
3.0000
>> [col1,col2]=textread('PREGUNTA1MATLAB.txt')
col1 =
1.0000
2.5000
3.2000
3.5000
2.0000
7.8000
8.1000
METODOS NUMERICOS
20
col2 =
7.5000
4.0000
5.0000
5.5000
6.3000
6.2000
6.0000
5.0000
3.0000
>> plot(col1,col2)
METODOS NUMERICOS
21
3. Graficar :
a. x2-y2=3
>> x= 0:0.5:5;
>> y=sqrt((x.^2)-3);
>> plot(x,y)
b. [[x]]+ lyl = 10
>> x=0:0.5:5;
>> y=10-floor(x);
>>plot(x,y)
METODOS NUMERICOS
22
METODOS NUMERICOS
23
b) r2 5, 0:/ 20: 2
>> a=0:pi/20:2*pi;
>> polar(a,5*a)
c) r3 2
sen(), 0: /
20: 2
>> a=0:pi/20:2*pi;
>> polar(a,2-sin(a))
METODOS NUMERICOS
24
5.
Use subplot para dividir la ventana en 1x2 para luego graficar en ellas las
siguientes curvas paramtricas (R R2).
SOLUCION:
>> subplot(1,2,1);
>> syms t, ezplot(sin(t),sin(2*t),[0,2 *pi]);
>> subplot(1,2,2);
>> syms t, ezplot(sin(t),cos(t),[0,2 *pi]);
METODOS NUMERICOS
25
METODOS NUMERICOS
26