title: Extracting a slice of data from a 3D data in Matlab
body: <p>I have a 3 dimensional dataset of size 150x220x250 many scalar values. I look it at it as a stack of 150 slices of dimensions 220x250. I want to extract one of these 150 slices of 220x250. I used this command to extract the slice</p>
  
  <pre><code>slice = mydata(20, :, :);
  </code></pre>
  
  <p>This resulted in slice being of dimensions 220 x 250 <strong>x 1</strong>. I want the slice to be of dimensions 220 x 250 only. Can you please show me what Matlab command will help me get the desired slice as I need it.</p>