squeeze
Remove dimensions of length 1
Syntax
Description
B = squeeze(
returns an array with the same elements as the input arrayA
)A
, but with dimensions of length 1 removed. For example, ifA
is a 3-by-1-by-1-by-2 array, thensqueeze(A)
returns a 3-by-2 matrix.
IfA
is a row vector, column vector, scalar, or an array with no dimensions of length 1, thensqueeze
returns the inputA
.