title: Storing Results of a Operation in a Matrix
body: <p>Let's say I want to take the sin of 1 through 100 (in degrees).</p>
  
  <p>I come from a C background so my instinct is to loop 1 through 100 in a for loop (something I can do in Matlab). In a matrix/vector/array I would store sin(x) where x is the counter of the for loop. </p>
  
  <p>I cannot figure out how to do this in Matlab. Do I create a array like </p>
  
  <pre><code>x = [1 .. 100];
  </code></pre>
  
  <p>And then do </p>
  
  <pre><code>x[offset] = numberHere;
  </code></pre>
  
  <p>I know the "correct" way. For operations like addition you use .+ instead of + and with a function like sin I'm pretty sure you just do</p>
  
  <pre><code>resultArray = sin(x);
  </code></pre>
  
  <p>I just want to know that I <em>could</em> do it the C way in case that ever came up, thus my question here on SO. :)</p>