Documentation

Squeeze

Remove singleton dimensions from multidimensional signal

Library

Math Operations

Description

The Squeeze block removes singleton dimensions from its multidimensional input signal. A singleton dimension is any dimension whose size is one. The Squeeze block operates only on signals whose number of dimensions is greater than two. Scalar, one-dimensional (vector), and two-dimensional (matrix) signals pass through the Squeeze block unchanged.

Data Type Support

The Squeeze block accepts input signals of any dimension and of any data type that Simulink® supports, including fixed-point and enumerated data types. For more information, see Data Types Supported by Simulink in the Simulink documentation.

Parameters and Dialog Box

Examples

In the following model, the Squeeze block converts a multidimensional array of size 3-by-1-by-2 into a 3-by-2 signal:

Because the Constant block supplies a signal with random values to the Squeeze block, the values in the Display block vary from simulation to simulation.

Characteristics

Data Types

Double | Single | Boolean | Base Integer | Fixed-Point | Enumerated

Sample Time

Inherited from driving block

Direct Feedthrough

Yes

Multidimensional Signals

Yes

Variable-Size Signals

No

Zero-Crossing Detection

No

Code Generation

Yes

See Also

Reshape

Introduced in R2007b

Was this topic helpful?