title: How to represent a square wave in Matlab?
body: <p>I have to represent a square wave in Matlab with amplitude 0.19 and period 495 samples and I don't know how to do. I have to do this because I have to estimate the function P(z) in the figure. I know the input w (is a vector with 5000 elements), I know r (another vector with length 5000), and I know that n(t) is this square wave, so I have to represent it in order to obtain the output of P(z) as r(t)-n(t). Can someone help me please?</p>
  <p><img src="https://i.stack.imgur.com/73Xkz.png" alt="[figure]" /></p>
  <p>I just know that in Matlab there is the command <code>x=square(t)</code> that considers period 2pi, and I really don't know how to change it in order to represent my period and my amplitude. For the amplitude I just have to multiply the value for <code>square(t)</code> maybe?</p>