MATLAB: Generate square wave starting from 0

square

I want to make square wave with function square which starts from 0 and not with amplitude

Best Answer

[zeroes(1,M), ones(1,N)] repeated as necessary .