||Declare variable-size array|
Variable-size data is data whose size is not known at compile time or whose size can change at run time.
Use the Ports and Data Manager to enable or disable variable-size data support in a MATLAB Function block
Use the Ports and Data Manager to specify the size and upper bound of variable-size inputs and outputs.
Choose a method for defining variable-size data.
Generate C/C++ code that uses dynamic memory allocation.
Disable dynamic memory allocation or specify a dynamic memory allocation threshold for MATLAB Function blocks.
To avoid dynamic memory allocation, specify upper bounds for a variable-size array.
Sometimes, the results for variable-size data in generated code are different than the results in MATLAB®.
Some restrictions for variable-size data apply to multiple toolbox functions.
Simulate a model that uses a variable-size vector to store the values of a white noise signal.
Troubleshoot size mismatch and upper bounds detection errors.