title: How to draw a signal that is piecewise constant and piecewise wave function
body: <p>I am a very new in Matlab. How can I draw a signal containing a constant, a wave function, and another constant, as in the image below?</p>
  
  <p><a href="https://i.stack.imgur.com/bj3xA.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/bj3xA.png" alt="signal"></a></p>