UsesWorksheet>UsesWorksheet.openBook (Calls: 2, Time: 0.012 s)
Generated 04-Jun-2021 04:11:08 using performance time.
class method in file C:\Program Files\MATLAB\R2020b\toolbox\matlab\io\spreadsheet\+matlab\+io\+internal\+functions\UsesWorksheet.m
Copy to new window for comparing multiple runs
Function Name | Function Type | Calls |
...etectImportOptionsSpreadsheet.execute | class method | 2 |
Line Number | Code | Calls | Total Time | % Time | Time Plot |
26 | obj.WorkbookObj = createWorkbo... | 2 | 0.011 s | 91.5% | |
39 | obj.IsComObject = obj.Workbook... | 2 | 0.000 s | 2.0% | |
19 | if isempty(sheet) | 2 | 0.000 s | 1.9% | |
40 | end | 2 | 0.000 s | 0.0% | |
23 | if isempty(UseExcel) | 2 | 0.000 s | 0.0% | |
All other lines | 0.001 s | 4.6% | |||
Totals | 0.012 s | 100% |
Function Name | Function Type | Calls | Total Time | % Time | Time Plot |
createWorkbook | function | 2 | 0.010 s | 86.9% | |
Self time (built-ins, overhead, etc.) | 0.002 s | 13.1% | |||
Totals | 0.012 s | 100% |
Total lines in function | 26 |
Non-code lines (comments, blank lines) | 5 |
Code lines (lines that can run) | 21 |
Code lines that did run | 10 |
Code lines that did not run | 11 |
Coverage (did run/can run) | 47.62 % |
time | Calls | line | |
---|---|---|---|
15 | function openBook(obj,filename, sheet, fmt, UseExcel) | ||
16 | import matlab.io.spreadsheet.internal.*; | ||
< 0.001 | 2 | 17 | try |
18 | % By default load only the first sheet | ||
< 0.001 | 2 | 19 | if isempty(sheet) |
< 0.001 | 2 | 20 | sheet = 1; |
< 0.001 | 2 | 21 | end |
22 | % Use LibXL by default | ||
< 0.001 | 2 | 23 | if isempty(UseExcel) |
24 | UseExcel = false; | ||
< 0.001 | 2 | 25 | end |
0.011 | 2 | 26 | obj.WorkbookObj = createWorkbook(fmt,filename,UseExcel,sheet); |
27 | catch ME | ||
28 | if any(ME.identifier == ["MATLAB:spreadsheet:book:chartsheetError", ... | ||
29 | "MATLAB:spreadsheet:book:invalidFormatUnix"]) || ~ispc | ||
30 | rethrow(ME); | ||
31 | else | ||
32 | if ~isempty(sheet) | ||
33 | sheet = ''; | ||
34 | end | ||
35 | obj.WorkbookObj = createWorkbook(fmt,filename,true,sheet); | ||
36 | end | ||
< 0.001 | 2 | 37 | end |
38 | % .ods and .xlsb files are interactive. Therefore, they require the use of an Excel COM server to be read properly. | ||
< 0.001 | 2 | 39 | obj.IsComObject = obj.WorkbookObj.Interactive; |
< 0.001 | 2 | 40 | end |
Other subfunctions in this file are not included in this listing.