validateVariableNameLength (Calls: 16, Time: 0.004 s)
Generated 16-Jul-2020 17:09:34 using performance time.
function in file /Applications/MATLAB_R2020a.app/toolbox/matlab/datatypes/tabular/+matlab/+internal/+tabular/validateVariableNameLength.m
Copy to new window for comparing multiple runs
Function Name | Function Type | Calls |
varNamesDim>varNamesDim.makeValidName | class method | 8 |
metaDim>metaDim.checkAgainstVarLabels | class method | 8 |
Line Number | Code | Calls | Total Time | % Time | Time Plot |
8 | nameLengths = strlength(names)... | 16 | 0.003 s | 81.9% | |
15 | elseif all(nameLengths > 0) | 16 | 0.000 s | 5.1% | |
19 | end | 16 | 0.000 s | 1.2% | |
9 | tooLong = (nameLengths > na... | 16 | 0.000 s | 0.7% | |
10 | if any(tooLong) | 16 | 0.000 s | 0.2% | |
All other lines | 0.000 s | 10.8% | |||
Totals | 0.004 s | 100% |
Function Name | Function Type | Calls | Total Time | % Time | Time Plot |
strlength | function | 16 | 0.002 s | 65.9% | |
Self time (built-ins, overhead, etc.) | 0.001 s | 34.1% | |||
Totals | 0.004 s | 100% |
Total lines in function | 19 |
Non-code lines (comments, blank lines) | 8 |
Code lines (lines that can run) | 11 |
Code lines that did run | 5 |
Code lines that did not run | 6 |
Coverage (did run/can run) | 45.45 % |
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.003 | 16 | 8 | nameLengths = strlength(names); |
< 0.001 | 16 | 9 | tooLong = (nameLengths > namelengthmax); |
< 0.001 | 16 | 10 | if any(tooLong) |
11 | TooLongNames = names(tooLong); | ||
12 | if nargout == 0 | ||
13 | error(message(tooLongErrorID, TooLongNames{1})) | ||
14 | end | ||
< 0.001 | 16 | 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 | 16 | 19 | end |
Other subfunctions in this file are not included in this listing.