This is a static copy of a profile report

Home

fileparts>legacyPCExecution (Calls: 8, Time: 0.004 s)
Generated 04-Jun-2021 04:11:06 using performance time.
subfunction in file C:\Program Files\MATLAB\R2020b\toolbox\matlab\iofun\fileparts.m
Copy to new window for comparing multiple runs

Parents (calling functions)

Function NameFunction TypeCalls
filepartsfunction8
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
242
ind = find(name == '.', 1, 'la...
80.000 s12.3%
209
ind = find(file == '/' | file ...
80.000 s11.9%
246
name(ind:end) = [];
80.000 s9.6%
203
file = char(file);
40.000 s5.7%
240
if ~isempty(name)
80.000 s5.5%
All other lines  0.002 s55.0%
Totals  0.004 s100% 
Children (called functions)
No children
Code Analyzer results
No Code Analyzer messages.
Coverage results
Show coverage for parent directory
Total lines in function56
Non-code lines (comments, blank lines)7
Code lines (lines that can run)49
Code lines that did run40
Code lines that did not run9
Coverage (did run/can run)81.63 %
Function listing
time 
Calls 
 line
 200 
function [pathstr, name, ext] = legacyPCExecution(file)
< 0.001 
      8 
 201
    if isstring(file) 
< 0.001 
      4 
 202
        inputWasString = true; 
< 0.001 
      4 
 203
        file = char(file); 
< 0.001 
      4 
 204
    else 
< 0.001 
      4 
 205
        inputWasString = false; 
< 0.001 
      8 
 206
    end 
< 0.001 
      8 
 207
    ext = ''; 
< 0.001 
      8 
 208
    pathstr = ''; 
< 0.001 
      8 
 209
    ind = find(file == '/' | file == '\', 1, 'last'); 
< 0.001 
      8 
 210
    if isempty(ind) 
< 0.001 
      4 
 211
        ind = find(file == ':', 1, 'last'); 
< 0.001 
      4 
 212
        if ~isempty(ind) 
 213 
            pathstr = file(1:ind);
< 0.001 
      4 
 214
        end 
< 0.001 
      4 
 215
    else 
< 0.001 
      4 
 216
        if ind == 2 && (file(1) == '/' || file(1) == '\') 
 217 
            % Special case for UNC server
 218 
            pathstr =  file;
 219 
            ind = length(file);
< 0.001 
      4 
 220
        else 
< 0.001 
      4 
 221
            pathstr = file(1:ind-1); 
< 0.001 
      4 
 222
        end 
< 0.001 
      8 
 223
    end 
< 0.001 
      8 
 224
    if isempty(ind) 
< 0.001 
      4 
 225
        name = file; 
< 0.001 
      4 
 226
    else 
< 0.001 
      4 
 227
        if ~isempty(pathstr) && pathstr(end)== ':' 
 228 
            % Don't append to D: which is a volume path on windows
 229 
            if length(pathstr) > 2
 230 
                pathstr = [pathstr filesep];
 231 
            elseif length(file) >= 3 && (file(3) == '/' || file(3) == '\')
 232 
                pathstr = [pathstr file(3)];
 233 
            end
< 0.001 
      4 
 234
        elseif isempty(deblank(pathstr)) 
 235 
            pathstr = filesep;
< 0.001 
      4 
 236
        end 
< 0.001 
      4 
 237
        name = file(ind+1:end); 
< 0.001 
      8 
 238
    end 
 239 

< 0.001 
      8 
 240
    if ~isempty(name) 
 241 
        % Look for EXTENSION part
< 0.001 
      8 
 242
        ind = find(name == '.', 1, 'last'); 
 243 

< 0.001 
      8 
 244
        if ~isempty(ind) 
< 0.001 
      8 
 245
            ext = name(ind:end); 
< 0.001 
      8 
 246
            name(ind:end) = []; 
< 0.001 
      8 
 247
        end 
< 0.001 
      8 
 248
    end 
 249 

< 0.001 
      8 
 250
    if inputWasString 
< 0.001 
      4 
 251
        pathstr = string(pathstr); 
< 0.001 
      4 
 252
        name = string(name); 
< 0.001 
      4 
 253
        ext = string(ext); 
< 0.001 
      8 
 254
    end 
< 0.001 
      8 
 255
end 

Other subfunctions in this file are not included in this listing.