MATLAB: How to plot the switching signal in matlab

switching signal

Best Answer

t=0:0.01:25; %time vector
width = 4; % train width
dela = width/2:width*2:25; % delays
pulse_vect=pulstran(t,dela,'rectpuls',width) + 1; % 1 is offset
% Plottig
figure, plot(t,pulse_vect, 'LineWidth', 2);
ylim([0, 2.5]), title('Not given')
xlabel('Time(s)'); ylabel('\sigma')
Related Question