squeeze
Remove dimensions of length 1
Syntax
Description
B = squeeze(
returns an
array with the same elements as the input array A
)A
, but with dimensions of
length 1 removed. For example, if A
is a 3-by-1-by-1-by-2 array, then
squeeze(A)
returns a 3-by-2 matrix.
If A
is a row vector, column vector, scalar, or an array with no
dimensions of length 1, then squeeze
returns the input
A
.
Examples
Input Arguments
Extended Capabilities
Version History
Introduced before R2006a