time | Calls | line |
---|
| | 1 | function tooLong = validateVariableNameLength(names,tooLongErrorID)
|
| | 2 | %VALIDATEVARIABLENAMELENGTH checks that variable names do not exceed namelengthmax.
|
| | 3 | % This function takes a cell array of variable names and errors if any are longer
|
| | 4 | % than namelengthmax.
|
| | 5 |
|
| | 6 | % Copyright 2018-2019 The MathWorks, Inc.
|
| | 7 |
|
0.001 | 1601 | 8 | nameLengths = strlength(names);
|
< 0.001 | 1601 | 9 | tooLong = (nameLengths > namelengthmax);
|
< 0.001 | 1601 | 10 | if any(tooLong)
|
| | 11 | TooLongNames = names(tooLong);
|
| | 12 | if nargout == 0
|
| | 13 | error(message(tooLongErrorID, TooLongNames{1}))
|
| | 14 | end
|
< 0.001 | 1601 | 15 | elseif all(nameLengths > 0)
|
| | 16 | % good names
|
| | 17 | else % 0-length or NaN.
|
| | 18 | error(message('MATLAB:table:ZeroLengthVarname')) % Not hit by metaDim
|
< 0.001 | 1601 | 19 | end
|
Other subfunctions in this file are not included in this listing.