Documentation Center

  • Trial Software
  • Product Updates

namelengthmax

Maximum identifier length

Syntax

len = namelengthmax

Description

len = namelengthmax returns the maximum length allowed for MATLAB® identifiers, which include:

  • Variable names

  • Structure field names

  • Script, function, and class names

  • Model names

Rather than hard-coding a specific maximum name length into your programs, use the namelengthmax function. This saves you the trouble of having to update these limits should the identifier length change in some future MATLAB release.

Examples

Call namelengthmax to get the maximum identifier length:

maxid = namelengthmax
maxid =
    63

See Also

| |

Was this topic helpful?