You are on page 1of 9

PRACTICA 3-Parte 1

This is a Classroom License for instructional use only.


Research and commercial use is prohibited.
>> num = [5 20];
>> den = [1 4 20];
>>
>> [z,p,k] = tf2zp(num, den)

z=

-4

p=

-2.0000 + 4.0000i
-2.0000 - 4.0000i

k=

>> [num,den] = zp2tf(z,p,k)

num =

5 20

den =

4 20

>> G = tf(num,den);
>> G = zpk(z,p,k)

Zero/pole/gain:

5 (s+4)
--------------(s^2 + 4s + 20)

>> p = [1 4 4 1 20]

p=

1 20

>> r = roots (p)

r=

-2.6545 + 1.2595i
-2.6545 - 1.2595i
0.6545 + 1.3742i
0.6545 - 1.3742i

>> p=poly([p1,p2,p3,p4]

??? p=poly([p1,p2,p3,p4]
|
Error: Expression or statement is incorrect--possibly unbalanced (, {, or [.

>> p=poly([p1,p2,p3,p4])
??? Undefined function or variable 'p1'.

>> Res{
??? Res{
|
Error: Expression or statement is incorrect--possibly unbalanced (, {, or [.

>> Res{p} = Lim (s-p)F(s)


??? Res{p} = Lim (s-p)F(s)
|
Error: Unexpected MATLAB expression.

>> [res,p]=residue(num,den)

res =

2.5000 - 1.2500i
2.5000 + 1.2500i

p=

-2.0000 + 4.0000i
-2.0000 - 4.0000i

>> [res,p,k
>> [res,p,k]=residue(num,den)

res =

2.5000 - 1.2500i
2.5000 + 1.2500i

p=

-2.0000 + 4.0000i
-2.0000 - 4.0000i

k=

[]

>> [num,den]=residue(res,p,k)

num =

5 20

den =

4 20

>> numg1=0.4;

deng1=1

deng1 =

>> numg1=0.4;

deng1=1;

>> numg2=100;

deng2=[1 2 0];

>> numh2=[1 0];

denh2=[1 20];

>> [numvc, denvc]=feedback(numg2,deng2,numh2,denh2,-1)

numvc =

100

2000

denvc =

1 22 140

>> [numec, denec]=series(numg1,deng1,numvc,denvc)

numec =

0 40 800

denec =

1 22 140

>> [num,den]=cloop(numec,denec,-1)

num =

0 40 800

den =

1 22 180 800

>> impulse(num,den)
>> step(num,den);
>> y=step(num,dent)
??? Undefined function or variable 'dent'.

>> step(num,den)
>> den = [1 0.8 4 0];
>> step(num,den)
PRACTICA 3 Parte2
This is a Classroom License for instructional use only.
Research and commercial use is prohibited.
>> num=[40 800];
>> den[1 22 180 800];
??? den[1 22 180 800];
|
Error: Unbalanced or unexpected parenthesis or bracket.

>> num=[40 800];

>> den=[1 22 180 800];


>> t= 0: 0.01 : 2;
>> y = step(num,den,t);
>> plot (t,y);
>> title(Respuesta al escalon unitario);
??? title(Respuesta al escalon unitario);
|
Error: The input character is not valid in MATLAB statements or expressions.

>> title('Respuesta al escalon unitario');


>> num=[40 800];
>> den=[1 22 180 800];
>> t= 0: 0.01 : 2;
>> y = step(num,den,t);
>> plot (t,y);
>> title('Respuesta al escalon unitario');
>> xlabel('Tiempo(seg.)');
>> xlabel('Salida del sistema');
>> text (0.5,1.1,'maximo valor');
>> grid
>> t=0:pi/20:2*pi;
>> y1=sin(t);
>> y2=sin(t-pi/2);
>> y3=sin(t-pi);
>> plot (t,y1);
>> hold on;
>> plot (t,y2);
>> plot (t,y3);
>> hold off
>> plot (t,y1,'-.rx');

>> plot (t,y2,'--mo');


>> plot (t,y3,':bs')
>> plot (t,y3,':bs');
>> plot (t,y2,'--mo');
>> plot (t,y1,'-.rx');
>> legend('sin(t)','sin(t-pi/2)','sin(t-pi)')
Warning: Ignoring extra legend entries.
> In legend at 293
This is a Classroom License for instructional use only.
Research and commercial use is prohibited.
>> num=[40 800];
>> den[1 22 180 800];
??? den[1 22 180 800];
|
Error: Unbalanced or unexpected parenthesis or bracket.

>> num=[40 800];


>> den=[1 22 180 800];
>> t= 0: 0.01 : 2;
>> y = step(num,den,t);
>> plot (t,y);
>> title(Respuesta al escalon unitario);
??? title(Respuesta al escalon unitario);
|
Error: The input character is not valid in MATLAB statements or expressions.

>> title('Respuesta al escalon unitario');


>> num=[40 800];
>> den=[1 22 180 800];
>> t= 0: 0.01 : 2;

>> y = step(num,den,t);
>> plot (t,y);
>> title('Respuesta al escalon unitario');
>> xlabel('Tiempo(seg.)');
>> xlabel('Salida del sistema');
>> text (0.5,1.1,'maximo valor');
>> grid
>> t=0:pi/20:2*pi;
>> y1=sin(t);
>> y2=sin(t-pi/2);
>> y3=sin(t-pi);
>> plot (t,y1);
>> hold on;
>> plot (t,y2);
>> plot (t,y3);
>> hold off
>> plot (t,y1,'-.rx');
>> plot (t,y2,'--mo');
>> plot (t,y3,':bs')
>> plot (t,y3,':bs');
>> plot (t,y2,'--mo');
>> plot (t,y1,'-.rx');
>> legend('sin(t)','sin(t-pi/2)','sin(t-pi)')
Warning: Ignoring extra legend entries.
> In legend at 293

You might also like