ReadTable>ReadTable.execute (Calls: 2, Time: 0.398 s)
Generated 04-Jun-2021 04:11:08 using performance time.
class method in file C:\Program Files\MATLAB\R2020b\toolbox\matlab\io\functions\+matlab\+io\+internal\+functions\ReadTable.m
Copy to new window for comparing multiple runs
Function Name | Function Type | Calls |
...ExecutableFunction.validateAndExecute | class method | 2 |
Line Number | Code | Calls | Total Time | % Time | Time Plot |
33 | func.Options = func.execute@ma... | 2 | 0.226 s | 56.8% | |
44 | t = func.execute@matlab.io.int... | 2 | 0.153 s | 38.4% | |
49 | t.Properties.VariableNames(ext... | 2 | 0.008 s | 2.1% | |
13 | func.EmptyColumnType = 'double... | 2 | 0.005 s | 1.3% | |
48 | names = matlab.lang.makeUnique... | 2 | 0.002 s | 0.4% | |
All other lines | 0.004 s | 0.9% | |||
Totals | 0.398 s | 100% |
Function Name | Function Type | Calls | Total Time | % Time | Time Plot |
...ptions>DetectImportOptions.execute | class method | 2 | 0.225 s | 56.6% | |
...gt;ReadTableWithImportOptions.execute | class method | 2 | 0.153 s | 38.4% | |
tabular.subsasgn | function | 2 | 0.008 s | 1.9% | |
...tectImportOptions.set.EmptyColumnType | class method | 2 | 0.005 s | 1.2% | |
makeUniqueStrings | function | 2 | 0.001 s | 0.3% | |
tabular.subsref | function | 2 | 0.000 s | 0.1% | |
tabular.height | function | 2 | 0.000 s | 0.1% | |
tabular.width | function | 2 | 0.000 s | 0.1% | |
...ns>ImportOptions.get.VariableNames | class method | 2 | 0.000 s | 0.1% | |
compose | function | 2 | 0.000 s | 0.0% | |
Self time (built-ins, overhead, etc.) | 0.005 s | 1.3% | |||
Totals | 0.398 s | 100% |
Total lines in function | 43 |
Non-code lines (comments, blank lines) | 6 |
Code lines (lines that can run) | 37 |
Code lines that did run | 19 |
Code lines that did not run | 18 |
Coverage (did run/can run) | 51.35 % |
time | Calls | line | |
---|---|---|---|
10 | function t = execute(func,supplied) | ||
11 | % Detect the appropriate object by file type | ||
< 0.001 | 2 | 12 | if ~supplied.EmptyColumnType |
0.005 | 2 | 13 | func.EmptyColumnType = 'double'; |
< 0.001 | 2 | 14 | end |
< 0.001 | 2 | 15 | if supplied.Delimiter |
16 | d = string(func.Delimiter); | ||
17 | if isscalar(d) | ||
18 | switch (d{1}) | ||
19 | case 'comma' | ||
20 | func.Delimiter = ','; | ||
21 | case 'semi' | ||
22 | func.Delimiter = ';'; | ||
23 | case 'space' | ||
24 | func.Delimiter = ' '; | ||
25 | case 'tab' | ||
26 | func.Delimiter = '\t'; | ||
27 | case 'bar' | ||
28 | func.Delimiter = '|'; | ||
29 | end | ||
30 | end | ||
< 0.001 | 2 | 31 | end |
< 0.001 | 2 | 32 | func.PreserveRange = supplied.Range; |
0.226 | 2 | 33 | func.Options = func.execute@matlab.io.internal.functions.DetectImportOptions(supplied); |
< 0.001 | 2 | 34 | if supplied.Encoding |
35 | % The import options now carries the encoding. No need to | ||
36 | % pass it on. | ||
37 | supplied.Encoding = false; | ||
< 0.001 | 2 | 38 | end |
< 0.001 | 2 | 39 | if supplied.TreatAsMissing && ~isempty(func.TreatAsMissing) |
40 | func.Options = func.Options.setvaropts(func.Options.SelectedVariableNames,... | ||
41 | 'TreatAsMissing',func.TreatAsMissing); | ||
< 0.001 | 2 | 42 | end |
43 | |||
0.153 | 2 | 44 | t = func.execute@matlab.io.internal.functions.ReadTableWithImportOptions(supplied); |
< 0.001 | 2 | 45 | if height(t) > 0 |
< 0.001 | 2 | 46 | names = t.Properties.VariableNames; |
0.001 | 2 | 47 | extraIdx = numel(func.Options.VariableNames)+1:width(t); |
0.002 | 2 | 48 | names = matlab.lang.makeUniqueStrings(compose('Var%d',extraIdx),names,namelengthmax); |
0.008 | 2 | 49 | t.Properties.VariableNames(extraIdx) = names; |
< 0.001 | 2 | 50 | end |
51 | |||
< 0.001 | 2 | 52 | end |
Other subfunctions in this file are not included in this listing.