Main Content

Generate Code for arguments Block That Validates Input Arguments

You can generate code for arguments blocks that perform input argument validation in your MATLAB® function. Input argument validation declares specific restrictions on function input arguments. Using argument validation, you can constrain the class, size, and other aspects of function input values without writing code in the body of the function to perform these tests. See Function Argument Validation.

Supported Features

Code generation supports most features of arguments blocks, including size and class validation, validation functions, and default values.

Code generation supports only varargin as a repeating argument. For varargin, size validation, class validation, and validation functions are not supported for code generation.

Code generation does not support these features of arguments blocks:

  • Repeating arguments other than varargin

  • Name-value arguments

  • Output argument validation

See Also

|

Related Topics