Flatten Layer
R2026bLibraries:
Deep Learning Toolbox /
Deep Learning Layers /
Sequence Layers
Description
The Flatten Layer block collapses the spatial dimensions of layer input into the channel dimension.
For example, if the input to the layer is an H-by-W-by-C-by-N-by-S array (sequences of images), then the flattened output is an (H*W*C)-by-N-by-S array.
The exportNetworkToSimulink function generates this block to represent a flattenLayer object.
Examples
Ports
Input
Output
Parameters
Programmatic Use: Add Block
To add the block programmatically, use the add_block function with one of these library block paths as the source.
"dlsequencelib/Flatten Layer"
Example: add_block("dlsequencelib/Flatten Layer","myModel/myBlock",MakeNameUnique="on")
Extended Capabilities
Version History
Introduced in R2024b


