title: Matlab: Creating mathematical functions
body: <p>I am new to Matlab and trying to do some mathematical problems
  I knew how to create function using the inline method,
  However i need to know how to use it to define functions with different domains.
  For example:</p>
  
  <pre><code>  g(t) =  1   for t&lt;=50
            2   for t&gt; 50
  </code></pre>
  
  <p>how is this possible?
  I have created a time vector using T = [0:0.01:100] but how to relate between the two?
  Thanks all for your time :)</p>