Trabajo

7
MATRIZ TRES POR TRES >> A=[1 2 3;2 4 4;2 3 4] A = 1 2 3 2 4 4 2 3 4 VECTOR UNO POR TRES >> B=[1 2 3] B = 1 2 3 VECTOR TRES POR UNO >> C=[1;2;3;] C = 1 2 3 >> x1=(-b + s!"(b#2-4$%$&'' (2$%' x1 = -2)**** + 3)**** >> x2=(-b - s!"(b#2-4$%$&'' (2$%' x2 =

description

control

Transcript of Trabajo

MATRIZ TRES POR TRES>> A=[1 2 3;2 4 4;2 3 4]

A =

1 2 3 2 4 4 2 3 4VECTOR UNO POR TRES>> B=[1 2 3]

B =

1 2 3VECTOR TRES POR UNO>> C=[1;2;3;]

C =

1 2 3

>> x1=(-b + sqrt(b^2-4*a*c))/(2*a)

x1 =

-2.0000 + 3.0000i

>> x2=(-b - sqrt(b^2-4*a*c))/(2*a)x2 =

-2.0000 - 3.0000i

INTRODUCCION EN MATLAB DE POLINOMIOS>> P=[2 7 1]

P =

2 7 1

>> q=[1 0 3 0]

q =

1 0 3 0CALCULAR EL VALOR DEL POLINOMIO>> p=[1 5 8 1];>> x=2;>> polyval(p,x)

ans =

45>> p=[1 -3 9 13];>> roots(p)

ans =

2.0000 + 3.0000i 2.0000 - 3.0000i -1.0000

>> raices=[-1 2+3i 2-3i];>> poly(raices)

ans =

1 -3 9 13>> p1=[1 -2 1]; p2=[1 1];>> conv(p1,p2)

ans =

1 -1 -1 1

>> [c,r]=deconv(p1,p2)

c =

1 -3

r =

0 0 4

>>GENERAR EL VECTOR TIEMPO DE ANALISIS >> t=[0:0.5:4]

t =

0 0.5000 1.0000 1.5000 2.0000 2.5000 3.0000 3.5000 4.0000

>>OPERACIN CON VECTORES Y UN ESCALAR >> k=10; v1=[1 2 3]; v2=[4 5 6];>> k*v1

ans =

10 20 30

>> v1+v2

ans =

5 7 9

>> v1.*v2

ans =

4 10 18

>>GRAFICA >> t=[0:0.1:10];y=10*exp(-t).*sin(5*t);plot(t,y,'r')>> grid on>> ylabel('y(t)')>> xlabel('tiempo(s)')>> title('senoide amortiguada')

>> fplot('10*exp(-t).*sin(5*t)',[0,10])>> grid on>> xlabel('tiempo(s)')>> ylabel('y(t)')>> title('senoide amortiguada')

t=[0:pi/180:4*pi];>> y1=sin(t);>> y2=cos(t);>> plot(t,y1,'r o',t,y2,'g -')>>

>> t=0:0.1:10;>> subplot(2,2,1)>> y1=exp(-t);>> plot(t,y1)>> subplot(2,2,2)>> y2=t.*exp(-t);>> plot(t,y2)>> subplot(2,2,3)>> y3=exp(-t).*cos(t);>> plot(t,y3)>> subplot(2,2,4)>> y4=exp(t).*cos(t);>> plot(t,y4)