graphics/private/name>fixTilde (6 calls, 0.010 sec)
Generated 14-Nov-2016 07:47:16 using cpu time.
subfunction in file /usr/local/MATLAB/MATLAB_Production_Server/R2015a/toolbox/matlab/graphics/private/name.m
Copy to new window for comparing multiple runs
Function Name | Function Type | Calls |
graphics/private/name | function | 6 |
Line Number | Code | Calls | Total Time | % Time | Time Plot |
134 | if (isunix && (length(... | 6 | 0.010 s | 100.0% | ![]() |
152 | end | 6 | 0 s | 0% | ![]() |
135 | if (fileName(1) == '~' &&a... | 6 | 0 s | 0% | ![]() |
132 | filename = fileName; | 6 | 0 s | 0% | ![]() |
131 | persistent homeDir; % keep tra... | 6 | 0 s | 0% | ![]() |
All other lines | 0 s | 0% | ![]() | ||
Totals | 0.010 s | 100% |
Function Name | Function Type | Calls | Total Time | % Time | Time Plot |
isunix | function | 6 | 0.010 s | 100.0% | ![]() |
Self time (built-ins, overhead, etc.) | 0 s | 0% | ![]() | ||
Totals | 0.010 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 | 5 |
Code lines that did not run | 10 |
Coverage (did run/can run) | 33.33 % |
time | calls | line | |
---|---|---|---|
130 | function filename = fixTilde(fileName) | ||
6 | 131 | persistent homeDir; % keep track of user's home dir | |
6 | 132 | filename = fileName; | |
133 | % yes, we tested for isunix above...but in case that test gets deleted | ||
0.01 | 6 | 134 | if (isunix && (length(fileName) > 1)) |
6 | 135 | if (fileName(1) == '~' && fileName(2) == filesep) | |
136 | if isempty(homeDir) | ||
137 | % save current location, | ||
138 | % go 'home' and remember that location | ||
139 | % switch back to original location | ||
140 | currDir = pwd; | ||
141 | cd('~'); | ||
142 | homeDir = pwd; | ||
143 | cd(currDir); | ||
144 | end | ||
145 | if ~isempty(homeDir) | ||
146 | % now that we know where the home dir is | ||
147 | % replace 1st char (~) with user's home dir and take rest of | ||
148 | % path specified | ||
149 | filename = [homeDir fileName(2:end)]; | ||
150 | end | ||
151 | end | ||
6 | 152 | end |
Other subfunctions in this file are not included in this listing.