title: How do I create an array of image in matlab
body: <p>I read one by one images from a directory and I wish to create an array of images with that to pass to my mexFunction that processes these images. What I am tried so far is not working.  Let say I have 100 images 256x256 when I do</p>
  
  <pre><code> directory = uigetdir; fileList = dir(directory); imageVolume= [];
  
  for idx = 3:numel(fileList)
  
       tempImage = imread(fullfile(directory, fileList(idx).name));
      imageVolume= [imageVolume tempImage]; 
   end
  </code></pre>
  
  <p>Whenever I do that, I don't get an array of 256x256xn, instead I just get an image of 256x(256*n), which is not what I want.  Any idea?</p>