MATLAB: Can i know the way to code the square wave in Matlab

square wavesquarewave

can i know the way to code the square wave in Matlab? the square wave that i need to solve just like in the picture

Best Answer

t=0:0.01:20;
y=square(t,50),
plot(t,y)