title: MATLAB: how to apply function componentwise
body: <p>Say I have a function calculateStuff(x) that takes in a scalar as parameter and returns a scalar.</p>
  
  <p>Say I have a vector X and I want to apply calculateStuff on every component in X, and get a vector of the results in return and store it in a new vector Y.</p>
  
  <p>Clearly Y=calculateStuff(X) is illegal, is there a way I can do this besides looping?</p>