Matlab TP
Matlab TP
plot(0:0.01:1,0:0.01:1)
>> t=0:0.1:10;
>> plot(t,ones(size(t)))
plot(0:0.1:10,sin(0:0.1:10))
>> t=0.03*[0:100];
>> plot(t,expo(-t),'r-');
>> t=0:0.01:5;
>> plot(t,exp(-
t).*sin(2*pi*t));
>> grid
t=0:0.01:6;
>> plot(t,t,'b',t,t-
ones(size(t))+exp(-t),'r--');
>> legend('rampe','rampe
amortie')
>> t=0:0.01:6;
>> plot(t,t,'b',t,t-
ones(size(t))+exp(-t),'r--');
>> legend('rampe','rampe
amortie')
>> grid
>> echo on
>> t=0:0.2:5;
>> stem(t,exp(-
t).*sin(2*t),'fill');
>> grid
>> echo on
>> t=0:0.2:5;
>> stem(t,exp(-
t).*sin(2*t),'fill');
>> grid
>> gtext('exp(-
t)*sin(2*t),T=0.2 seconde')
>> t=0:.2:5;
>> stairs(t,exp(-
t).*sin(2*t));
>> grid
>> t=0:0.2:5;
>> f=exp(-t).*sin(2*t);
>> hold on
>>
stem(t,0.1*fix(f/.1),'fill');
>> stairs(t,f);
>> grid
>> G1=tf([1 2],[1 3 0]) G1 =
s+2
---------
s^2 + 3 s
Continuous-time transfer
function.
>> Te=1; G2 =
>> G2=tf([1 0.5],[1 -
0.2],Te) z + 0.5
-------
z - 0.2
5 (s+2)
-------
s (s+3)
Continuous-time
zero/pole/gain model.
>> F1=c2d(G1,Te,'zoh')
F1 =
0.7722 z - 0.1388
----------------------
z^2 - 1.05 z + 0.04979
>> laplace(t^2)
ans =
2/s^3
1/(s + 2)
exp(-t/2)/2
>> ilaplace(1/s) ans =
>> ilaplace(1/(s*s))
ans =
w/(w - 1)^2
>> iztrans(2*z/((z-1)^2))
ans =
2*n
2 (s+1)
-------
s^2
Continuous-time
zero/pole/gain model.
>> F=c2d(G,1,'zoh') F=
3 (z-0.3333)
------------
(z-1)^2
Sample time: 1 seconds
Discrete-time zero/pole/gain
model.
>> d2c(F) ans =
2 (s+1)
-------
s^2
Continuous-time
zero/pole/gain model.
>> s=tf('s'); F11 =
>>
F11=10*(s+4)/(s*(2*s+5)*( 10 s + 40
s+3)) ---------------------
2 s^3 + 11 s^2 + 15 s
Continuous-time transfer
function.
>> T1=1;
>> Te=1; F10 =
>>
z=tf('z',Te);F10=(2*z+1)/((z 2z+1
-1)*(z-0.5)) -----------------
z^2 - 1.5 z + 0.5