Transfer Function 22
Transfer Function 22
Step)
Step 1: Open MATLAB
Launch MATLAB and open the Command Window or a script file (.m file).
matlab
CopyEdit
num = [5 3]; % Coefficients of the numerator (5s + 3)
den = [1 4 6]; % Coefficients of the denominator (s^2 + 4s + 6)
matlab
CopyEdit
H = tf(num, den);
disp('Transfer Function:');
disp(H);
A step response shows how the system reacts to a unit step input.
matlab
CopyEdit
step(H);
title('Step Response of the System');
matlab
CopyEdit
impulse(H);
title('Impulse Response of the System');
matlab
CopyEdit
bode(H);
title('Bode Plot of the System');
The pole-zero map shows the stability and dynamic behavior of the system.
matlab
CopyEdit
pzmap(H);
title('Pole-Zero Map');
matlab
CopyEdit
z = [-1 -2]; % Zeros
p = [-3 -4]; % Poles
k = 5; % Gain
H_zpk = zpk(z, p, k); % Define transfer function in zero-pole-gain format
disp(H_zpk);
matlab
CopyEdit
[A, B, C, D] = tf2ss(num, den);
disp('State-Space Representation:');
disp('A = '); disp(A);
disp('B = '); disp(B);
disp('C = '); disp(C);
disp('D = '); disp(D);
Summary of MATLAB Steps