title: Guide to Optimizing MATLAB Code
body: <p>I have noticed many individual questions on SO but no one good guide to MATLAB optimization.</p>
  
  <p><strong>Common Questions:</strong></p>
  
  <ul>
  <li>Optimize this code for me</li>
  <li>How do I vectorize this?</li>
  </ul>
  
  <p>I don't think that these questions will stop, but I'm hoping that the ideas presented here will them something centralized to refer to.</p>
  
  <p>Optimizing Matlab code is kind of a black-art, there is always a better way to do it. And sometimes it is straight-up impossible to vectorize your code.</p>
  
  <p>So my question is: when vectorization is impossible or extremely complicated, what are some of your tips and tricks to optimize MATLAB code? Also if you have any common vectorization tricks I wouldn't mind seeing them either.</p>