MATLAB: How to plot an odd, 50% duty cycle square wave with a fundamental period of 4 seconds

odd square wave

I need to plot an odd square wave with duty cycle 50% and fundamental period of 4 seconds. Please help me to solve

Best Answer

t = 0:0.01:12;
y = sign(sin(2*pi*t/4));
plot(t, y)