title: Building an array while looping
body: <p>I have a for loop that loops over one array...</p>
  
  <pre><code>for i=1:length(myArray)
  </code></pre>
  
  <p>In this loop, I want to do check on the value of myArray and add it to another array myArray2 if it meets certain conditions. I looked through the MATLAB docs, but couldn't find anything on creating arrays without declaring all their values on initialization or reading data into them in one shot.</p>
  
  <p>Many thanks!</p>