Convert 1-D to 2-D

Reshape 1-D or 2-D input to 2-D matrix with specified dimensions

Library

Signal Management / Signal Attributes

dspsigattribs

Description

The Convert 1-D to 2-D block reshapes a length-Mi 1-D vector or an Mi-by-Ni matrix to an Mo-by-No matrix, where Mo is specified by the Number of output rows parameter, and No is specified by the Number of output columns parameter.

y = reshape(u,Mo,No)							% Equivalent MATLAB code

The input is reshaped columnwise, as shown in the two cases below. The length-6 vector and the 2-by-3 matrix are both reshaped to the same 3-by-2 output matrix.

An error is generated when (Mo*No)≠(Mi*Ni). That is, the total number of input elements must be conserved in the output.

The output is frame based when you select the Frame-based output check box; otherwise, the output is sample based.

Dialog Box

Number of output rows

The number of rows, Mo, in the output matrix.

Number of output columns

The number of rows, No, in the output matrix.

Frame-based output

Creates a frame-based output when selected.

HDL Code Generation

This block supports HDL code generation using HDL Coder™. HDL Coder provides additional configuration options that affect HDL implementation and synthesized logic. For more information on implementations, properties, and restrictions for HDL code generation, see Convert 1-D to 2-D in the HDL Coder documentation.

Supported Data Types

PortSupported Data Types

Input

  • Double-precision floating point

  • Single-precision floating point

  • Fixed point (signed and unsigned)

  • Boolean

  • 8-, 16-, and 32-bit signed integers

  • 8-, 16-, and 32-bit unsigned integers

Output

  • Double-precision floating point

  • Single-precision floating point

  • Fixed point (signed and unsigned)

  • Boolean

  • 8-, 16-, and 32-bit signed integers

  • 8-, 16-, and 32-bit unsigned integers

See Also

BufferDSP System Toolbox
Convert 2-D to 1-DDSP System Toolbox
Frame ConversionDSP System Toolbox
ReshapeSimulink
SubmatrixDSP System Toolbox

Was this topic helpful?