tabularDimension>tabularDimension.selectFrom (Calls: 108859, Time: 1.941 s)
Generated 04-Jun-2021 04:11:12 using performance time.
class method in file C:\Program Files\MATLAB\R2020b\toolbox\matlab\datatypes\tabular\+matlab\+internal\+tabular\+private\tabularDimension.m
Copy to new window for comparing multiple runs
Function Name | Function Type | Calls |
varNamesDim>varNamesDim.selectFrom | class method | 38264 |
...mension>tabularDimension.subs2inds | class method | 70595 |
Line Number | Code | Calls | Total Time | % Time | Time Plot |
112 | obj.labels = obj.orientAs(obj.... | 107934 | 1.458 s | 75.1% | |
116 | if isnumeric(toSelect) &&a... | 107934 | 0.169 s | 8.7% | |
120 | obj.length = numel(obj.labels)... | 107934 | 0.145 s | 7.5% | |
132 | end | 108859 | 0.018 s | 0.9% | |
111 | if obj.hasLabels | 108859 | 0.017 s | 0.9% | |
All other lines | 0.135 s | 6.9% | |||
Totals | 1.941 s | 100% |
Function Name | Function Type | Calls | Total Time | % Time | Time Plot |
isUniqueNumeric | function | 38634 | 0.125 s | 6.4% | |
rowNamesDim>rowNamesDim.orientAs | class method | 69670 | 0.099 s | 5.1% | |
varNamesDim>varNamesDim.orientAs | class method | 38264 | 0.052 s | 2.7% | |
Self time (built-ins, overhead, etc.) | 1.666 s | 85.8% | |||
Totals | 1.941 s | 100% |
Total lines in function | 28 |
Non-code lines (comments, blank lines) | 11 |
Code lines (lines that can run) | 17 |
Code lines that did run | 9 |
Code lines that did not run | 8 |
Coverage (did run/can run) | 52.94 % |
time | Calls | line | |
---|---|---|---|
105 | function obj = selectFrom(obj,toSelect) | ||
106 | %SELECTFROM Return a subset of a tableDimimension for the specified indices. | ||
107 | % The indices might be out of order, that's OK or repeated, that's handled. | ||
108 | import matlab.internal.datatypes.isUniqueNumeric | ||
109 | import matlab.internal.datatypes.isColon | ||
110 | |||
0.017 | 108859 | 111 | if obj.hasLabels |
1.458 | 107934 | 112 | obj.labels = obj.orientAs(obj.labels(toSelect)); |
113 | |||
114 | % Only numeric subscripts can lead to repeated rows (thus labels), no | ||
115 | % need to check otherwise. | ||
0.169 | 107934 | 116 | if isnumeric(toSelect) && ~isUniqueNumeric(toSelect) |
117 | obj = obj.makeUniqueForRepeatedIndices(toSelect); | ||
0.005 | 107934 | 118 | end |
119 | |||
0.145 | 107934 | 120 | obj.length = numel(obj.labels); |
< 0.001 | 925 | 121 | elseif isnumeric(toSelect) |
0.005 | 925 | 122 | obj.length = numel(toSelect); |
123 | elseif islogical(toSelect) | ||
124 | obj.length = sum(toSelect); | ||
125 | elseif isColon(toSelect) | ||
126 | % leave obj.length alone | ||
127 | elseif isa(toSelect,'matlab.internal.ColonDescriptor') | ||
128 | obj.length = toSelect.length; | ||
129 | else | ||
130 | assert(false); | ||
0.005 | 108859 | 131 | end |
0.018 | 108859 | 132 | end |
Other subfunctions in this file are not included in this listing.