Polinomios Mary

21
POLINOMIOS >> P=[1 4 7 8], Q=[6 7 9 0 2] P = 1 4 7 8 Q = 6 7 9 0 2 >> polyval(P,2) ans = 46 >> X=-10:10 X = Columns 1 through 15 -10 -9 -8 -7 -6 -5 -4 -3 -2 -1 0 1 2 3 4 Columns 16 through 21 5 6 7 8 9 10 >> Y=polyval(P,X) Y = Columns 1 through 7 -662 -460 -304 -188 -106 -52 -20 Columns 8 through 14 -4 2 4 8 20 46 92 Columns 15 through 21 164 268 410 596 832 1124 1478 >> plot(X,Y)

description

MATLAB

Transcript of Polinomios Mary

Page 1: Polinomios Mary

POLINOMIOS

>> P=[1 4 7 8], Q=[6 7 9 0 2]

P =

1 4 7 8

Q =

6 7 9 0 2

>> polyval(P,2)

ans =

46

>> X=-10:10

X =

Columns 1 through 15

-10 -9 -8 -7 -6 -5 -4 -3 -2 -1 0 1 2 3 4

Columns 16 through 21

5 6 7 8 9 10

>> Y=polyval(P,X)

Y =

Columns 1 through 7

-662 -460 -304 -188 -106 -52 -20

Columns 8 through 14

-4 2 4 8 20 46 92

Columns 15 through 21

164 268 410 596 832 1124 1478

>> plot(X,Y)

Page 2: Polinomios Mary

>> P=[3 6 9 11], Q=[2 4 6 8 10]

P =

3 6 9 11

Q =

2 4 6 8 10

>> polyval(P,4)

ans =

335

Page 3: Polinomios Mary

>> X=-2:12

X =

-2 -1 0 1 2 3 4 5 6 7 8 9 10 11 12

>> Y=polyval(P,X)

Y =

Columns 1 through 7

-7 5 11 29 77 173 335

Columns 8 through 14

581 929 1397 2003 2765 3701 4829

Column 15

6167

>> plot(X,Y)

Page 4: Polinomios Mary

>> R=roots(P)

R =

-1.5740 + 0.0000i

-0.2130 + 1.5113i

-0.2130 - 1.5113i

>> P=[1 4 7 8], Q=[6 7 9 0 2]

P =

1 4 7 8

Q =

6 7 9 0 2

Page 5: Polinomios Mary

>> R=roots(Q)

R =

-0.6784 + 1.0400i

-0.6784 - 1.0400i

0.0951 + 0.4551i

0.0951 - 0.4551i

>> P=[1 4 7 8], Q=[6 7 9 0]

P =

1 4 7 8

Q =

6 7 9 0

>> W=P+Q

W =

7 11 16 8

>> W=4*P-3*Q

W =

-14 -5 1 32

>> C=conv(P,Q)

Page 6: Polinomios Mary

C =

6 31 79 133 119 72 0

>> P=[1 4 7 8], Q=[6 7 9 0]

P =

1 4 7 8

Q =

6 7 9 0

>> P=[1 4 7 8], Q=[6 7 9 0 1]

P =

1 4 7 8

Q =

6 7 9 0 1

>> [Q,R]=deconv(Q,P)

Q =

6 -17

Page 7: Polinomios Mary

R =

0 0 35 71 137

>> residue(P,Q)

ans =

13.7816

>> polyder(P,Q)

ans =

24 21 -52 -71

>> residue(P,D)

ans =

0.0718 - 0.0523i

0.0718 + 0.0523i

-0.0361 - 0.1436i

-0.0361 + 0.1436i

>> polyder(P,D)

ans =

98 426 870 1192 954 638 262

>> residue(L,D)

ans =

0

Page 8: Polinomios Mary

0

0

0

>> polyder(L,D)

ans =

0

line>> line;

x=-2:0.3:7;

y=sin(x.^4);

plot(x,y);

>> line;

>> x=-2:4.3:9;

>> y=sin(x.^10);

>> plot(x,y);

Page 9: Polinomios Mary

Bar

>> x=-6:0.3:2;

>> y=exp(-x.^2);

>> bar(x,y);

>> x=-8:0.4:2;

>> y=exp(-x.^4);

>> bar(x,y);

barh

Page 10: Polinomios Mary

x=-3:0.2:3;

y=cos(x.^3)-2.*x+1;

barh(x,y);

x=-6:0.4:9;

>> y=cos(x.^4)-2.*x+1;

>> barh(x,y);

>> x=8:0.5:10;

>> y=sin(x);

>> stairs(x,y);

Page 11: Polinomios Mary

x=2:0.2:10;

>> y=sin(x);

>> stairs(x,y);

polar

t=0:0.1:2*pi;

y=abs(sin(2*t).*cos(2*t));

polar(t,y);

>> t=0:0.2:4*pi;

>> y=abs(sin(2*t).*cos(2*t));

Page 12: Polinomios Mary

>> polar(t,y);

pie

>> x=6:1:14;

>> pie(x)

>> x=2:1:6;

>> pie(x)

rose

>> x=[1 9 6 8 7 4 5 28];

Page 13: Polinomios Mary

>> rose(x);

>> x=[1 2 6 8 7 4 9 21];

>> rose(x);

>> x=0:0.05:5;

y=sin(x);

z=cos(x);

plot(x,y,x,z);

Page 14: Polinomios Mary

>> x=0:0.03:11;

>> y=sin(x);

>> z=cos(x);

>> plot(x,y,x,z);

GRÁFICAS ESPECIALES EN EL PLANO

>> x=-pi:3.7:pi;

>> y=2-sin(x);

>> compass(x,y);

Page 15: Polinomios Mary

>> x=-pi:2.12:pi;

>> y=2-sin(x);

>> compass(x,y);

>> x=-pi:1.10:pi;

>> y=3-sin(x);

>> feather(x,y);

>> x=-pi:2.9:pi;

>> y=2-sin(x);

>> feather(x,y);

Page 16: Polinomios Mary

>> fplot('cos(x)',[-3,6]);

>> fplot('cos(x)',[-1,5]);

>> ezplot('4-abs(x)',[-5,23]);

Page 17: Polinomios Mary

>> ezplot('4-abs(x)',[-5,28]);

>> x=1:0.2:10;

y=11+exp(-x.^2);

loglog(x,y);

>> x=2:0.4:15;

>> y=9+exp(-x.^1);

>> loglog(x,y);

Page 18: Polinomios Mary

>> x=1:0.2:10;

y=cos(x);

fill (x,y, 'm');

>> x=3:0.2:25;

>> y=cos(x);

>> fill (x,y, 'm');

Page 19: Polinomios Mary

1.- Resolver el limite:

>> syms x

>> y=(x^3+1)/(1^2+1)

y =

x^3/2 + 1/2

>> l=limit(x,y,1)

l =

x

2.

>> syms x

y=(x^2-3)/(3*x^5+5*x)

>> l=limit(y,x,3)

l =

1/124

2) Aplicación de Derivadas Comprobar que la función y=Ae−2xcos(3x+b) es la solución de la ecuación diferencial que describe las oscilaciones amortiguadas, donde A y b son constantes que se determinan a partir de las condiciones iniciales (posición inicial y velocidad inicial).

>> syms x A b;

>> y=A*exp(-2*x)*cos(3*x+b);

Page 20: Polinomios Mary

>> diff(y,2)+4*diff(y)+13*y

ans =

0

2.si deseas derivar f=x3*cos(x)

>> f='x^3*cos(x)'

f =

x^3*cos(x)

>> diff(f,2)

ans =

-17 34 66 -45 -8 -79 155 -159

>> diff(f)

ans =

Columns 1 through 8

-26 -43 -9 57 12 4 -75 80

Column 9

-79