title: Plotting a series of 2D black and white plots in MATLAB
body: <p>I am trying to plot a series of 2D matrices containing ones and zeros (effectively black and white images) in MATLAB, which are ordered in 3D. </p>
  
  <p>The code I have so far is:</p>
  
  <pre><code>function PlotthreeD()
  
   numrows = 100;
   numcols = 100;
  
   Plot1 = zeros(numcols);
   Plot1(20:50,20:50) = 1;
  
   Plot2 = zeros(numcols);
   Plot1(20:70,20:90) = 1;
  
   Plot3 = zeros(numcols);
   Plot3(20:50,20:50) = 1;
  
           B = cat(3, Plot1, Plot2, Plot3);
  
   figure; 
   offset = 100;
   hold on; 
  
   for i=1:3; 
       mesh(B(:,:,i)+offset*(i));
   end
  
  end
  </code></pre>
  
  <p>Is there a drawing command (rather than mesh) that will allow me show the 2D arrays as solid shapes (where the matrix elements equal 1), rather than having a these regions shown as being raised (as they are with mesh)?</p>