MATLAB: Specify one dimension as variable size in Matlab Coder

matlab codermatrices

Hi!
I wish to graphically (in the matlab coder window) specify one dimension of an input as variable size and one dimension as fixed size. How do I achieve this?

Best Answer

Hi,
I guess you mean the MATLAB Coder project settings? When you specify the input variable, use a ":" to specify a variable dimension, e.g.,
:10 x 1
makes the number of rows variable (between 1,...,10) and the number of columns fixed. Use
:inf x 1
if you don't want to have an upper limit. Depending on the code you will need to use "dynamic memory" (on the memory tab) ...
Titus
Related Question