
Release Notes for Release 13
30
Maximum Name Length Changed for Variables, Functions,
Files
Prior to this release, the length of MATLAB identifiers (variable names,
function and subfunction names, structure field names, M-file names, MEX-file
names, and MDL-file names) was restricted to 31 characters. Names using
more than 31 characters were either truncated by MATLAB or caused a
warning or error to be generated.
In MATLAB 6.5, any of these names can be up to 63 characters long.
A new function,
namelengthmax, returns the maximum length for MATLAB
identifiers.
namelengthmax
ans =
63
If you have MATLAB programs that hard-code the maximum identifier length
as 31, you should replace these hard-coded limits with a call to
namelengthmax.
If you use identifiers that exceed 63 characters, MATLAB issues a warning and
truncates any characters beyond the 63rd.
Characters Beyond 31 Are No Longer Ignored
In previous versions of MATLAB, if you had two or more long identifiers in
which the first 31 characters were identical, MATLAB ignored any characters
beyond the 31st and thus recognized only one of the identifiers. For example,
given these two Stateflow filenames
stateflow_modelname_with_40_characters_1.mdl
stateflow_modelname_with_40_characters_2.mdl
both appeared to MATLAB 6.1 as shown below, and MATLAB recognized only
one of the files.
stateflow_modelname_with_40_cha.mdl
In MATLAB 6.5, with the maximum MDL-file name length increased to 63,
MATLAB recognizes both files. You should be aware of this change, as it could
possibly lead to unexpected behavior.
Comentarios a estos manuales