squeeze
Discard any dimensions of an array along which its size is 1.
(u)=squeeze(a)
Inputs
a Any array.
Outputs
u An array which has the same number of elements as the input, with possibly reduced number of dimensions.


Description
If the input, for example, is an mX1XnXpX1 array, the the size of the output is mXnXp .
Example
>>a=fix(rand(4,3,1,2)*100)
>>a
[:,1:3, 1, 1]
   74.0000   80.0000    1.0000
   36.0000    9.0000   51.0000
   67.0000   84.0000   56.0000
    7.0000   61.0000   61.0000
[:,1:3, 1, 2]
    1.0000   94.0000   91.0000
   64.0000   79.0000   59.0000
   82.0000   20.0000   45.0000
   63.0000   12.0000   62.0000

>>squeeze(a)
[:,1:3, 1]
   74.0000   80.0000    1.0000
   36.0000    9.0000   51.0000
   67.0000   84.0000   56.0000
    7.0000   61.0000   61.0000
[:,1:3, 2]
    1.0000   94.0000   91.0000
   64.0000   79.0000   59.0000
   82.0000   20.0000   45.0000
   63.0000   12.0000   62.0000

>>size(a)
          4          3          1          2

>>size(squeeze(a))
          4          3          2