FUNCTION REFERENCE

squeeze

Remove singleton dimensions.

Remove singleton dimensions.

Syntax

B = squeeze(A)

All arrays here are two-dimensional, so the result is A.

Example

squeeze([1 2; 3 4])   % [1 2; 3 4]

Example

size(squeeze(ones(2,1,3)))   % [2 3]

Differences from MATLAB: Removes singleton dimensions of numeric, logical, char and complex N-D arrays; 2-D input, cell and struct arrays are returned unchanged.

These are the engine’s help pages. Each page keeps its compatibility notes. File operations are unavailable in the browser.