name>fixTilde (Calls: 12, Time: 0.001 s)
Generated 16-Jul-2020 17:09:16 using performance time.
subfunction in file /Applications/MATLAB_R2020a.app/toolbox/matlab/graphics/printing/+matlab/+graphics/+internal/name.m
Copy to new window for comparing multiple runs
Function Name | Function Type | Calls |
name | function | 12 |
Line Number | Code | Calls | Total Time | % Time | Time Plot |
116 | if (isunix && (length(... | 12 | 0.001 s | 55.7% | |
113 | persistent homeDir; % keep tra... | 12 | 0.000 s | 18.9% | |
117 | if (fileName(1) == '~' &&a... | 12 | 0.000 s | 0.5% | |
134 | end | 12 | 0.000 s | 0.4% | |
133 | end | 12 | 0.000 s | 0.3% | |
All other lines | 0.000 s | 24.1% | |||
Totals | 0.001 s | 100% |
Function Name | Function Type | Calls | Total Time | % Time | Time Plot |
isunix | function | 12 | 0.000 s | 4.3% | |
Self time (built-ins, overhead, etc.) | 0.001 s | 95.7% | |||
Totals | 0.001 s | 100% |
Total lines in function | 23 |
Non-code lines (comments, blank lines) | 8 |
Code lines (lines that can run) | 15 |
Code lines that did run | 6 |
Code lines that did not run | 9 |
Coverage (did run/can run) | 40.00 % |
time | Calls | line | |
---|---|---|---|
112 | function filename = fixTilde(fileName) | ||
< 0.001 | 12 | 113 | persistent homeDir; % keep track of user's home dir |
< 0.001 | 12 | 114 | filename = fileName; |
115 | % yes, we tested for isunix above...but in case that test gets deleted | ||
< 0.001 | 12 | 116 | if (isunix && (length(fileName) > 1)) |
< 0.001 | 12 | 117 | if (fileName(1) == '~' && fileName(2) == filesep) |
118 | if isempty(homeDir) | ||
119 | % save current location, | ||
120 | % go 'home' and remember that location | ||
121 | % switch back to original location | ||
122 | currDir = pwd; | ||
123 | cd('~'); | ||
124 | homeDir = pwd; | ||
125 | cd(currDir); | ||
126 | end | ||
127 | if ~isempty(homeDir) | ||
128 | % now that we know where the home dir is | ||
129 | % replace 1st char (~) with user's home dir and take rest of | ||
130 | % path specified | ||
131 | filename = [homeDir fileName(2:end)]; | ||
132 | end | ||
< 0.001 | 12 | 133 | end |
< 0.001 | 12 | 134 | end |
Other subfunctions in this file are not included in this listing.