title: matlab vectorization if statement
body: <p>Can someone please tell me the vectorized implementation of following matlab code. Predicted is an array containing either of the two values "pos" or "neg". I have to copy the values when condition comes true. </p>
  
  <pre><code>    p = 1;
      box = zeros(size(bbox));
  
  
     for k = 1: size(predicted)
          if predicted(k) == 'pos'
              box(p,:) = bbox(k,:);
              p = p + 1;
          end
     end
  </code></pre>