MATLAB: What do the empty square brackets [] do in the expression executed by eval

MATLABmatlab functionsimulink

sys = eval([model '(0,[],[],''compile'')']);

Best Answer

"What do the empty square brackets [] do in the expression executed by eval?"
Nothing really.
MATLAB has positional input arguments. Many MATLAB functions use an empty numeric array (i.e. []) to indicate that an input argument is undefined, which allows further input arguments to be specified. In your example the 2nd and 3rd arguments are undefined, whilst the 1st and 4th arguments have defined values (i.e. 0 and the char vector 'compile' respectively).
That is all.
Read the function/model documentation to know if [] is accepted as an undefined positional input argument.
This has nothing to do with eval.