Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Can someone please help me with this matlab code. My a = 1, b = 5, c =9, d=3 PRO

ID: 2250226 • Letter: C

Question

Can someone please help me with this matlab code.
My a = 1, b = 5, c =9, d=3

PROBLEM STATEMENT Let a denote the leftmost nonzero digit of your student ID number, b the second leftmost nonzero digit, c the third leftmost nonzero digit, and d the fourth leftmost nonzero digit. Consider the system 10%2d2 (s + a)((s + a)2 + b2) a(ab2) (10c + s)2(100d + s)2 H (s) = 1. Represent the system in MATLAB using zpk. Determine and plot the impulse response h(t) and use 1siminto on it. 2. Determine and plot the step response g(t) and use stepinfo on it. 3. Use gensig to create a 10-sample per second 20-second duration periodic square wave with period 2 seconds. Let this be the input to the system. Determine and plot the output signal via lsim and use lsiminfo on it 4, Determine the Bode magnitude and phase plots using bode from w = 10-1 to w = 105. 5. Produce the pole-zero diagram using przplot.

Explanation / Answer

"Please check for poles and zeros locations once again."

%Practice problem
clear all;clc
t=[0:0.01:1]; % time of simulation run and sampling
K = (729/26)*1e6; % K in standard form
Z = [-1 (-1+5i) (-1-5i)]; % zeros for the given transfer function
P = [-90 -90 -300 -300]; % poles for the given transfer function

G = zpk(Z,P,K); % Transfer function of system

H_imp = impulse(G,t); % Impulse response for given system
figure
plot(t,H_imp) % impulse response plot
Imp_info = lsiminfo(H_imp,t); % Impulse response information

H_step = step(G,t) % Step response for given system
figure
plot(t,H_step) % plot for step response
Step_info = stepinfo(H_step,t) % step response information

[U,T] = gensig('square',2,20,0.1) % generating square waveform
Y_square = lsim(G,U,T) % System response with square waveform
figure
plot(T,Y_square) % plot response graph for Square input
Ysquare_info = lsiminfo(Y_square,T) % System info with square waveform

[MAG,Phase]=bode(G,{1e-1 5e5}); % bode plot
figure
bodeplot(G)

figure
pzmap(G) % pole-zero plot