namelengthmax
R2026bMaximum identifier length
Syntax
Description
l = namelengthmax returns the maximum length
allowed for MATLAB® identifiers. MATLAB identifiers include:
Variable names
Structure field names
Script, function, and class names
Use the namelengthmax function instead
of hard-coding a specific maximum name length into your programs.
Then, if the identifier length changes in a future MATLAB release,
it is not necessary to update this limit in your code.
Note
The maximum allowed identifier length for model names is 150.