title: Concatenate RGB channels with a loop 'for'
body: <p>I have R,G,B image channels of an image and I want to concatenate them to get the colored image using a <code>for</code> loop. Is it possible? </p>
  
  <p>I tried something like below but it gives me an error: </p>
  
  <pre><code>for i=1:3
     image=cat(3,img(:,:,i)
  end
  </code></pre>
  
  <p>I already know how to do it without a loop using the command <code>cat</code> : <code>image=cat(3,imgR,imgG,imgB)</code></p>