This is a static copy of a profile report

Home

fileparts (8 calls, 0.031 sec)
Generated 15-Mar-2007 12:02:08 using real time.
M-function in file C:\Program Files\MATLAB71\toolbox\matlab\iofun\fileparts.m
[Copy to new window for comparing multiple runs]

Parents (calling functions)

Function NameFunction TypeCalls
helptools\private\makehelphyperM-function2
help>displayHelpM-subfunction6
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
15
path = '';
80.000 s0.1%
34
orig_name = name;
80.000 s0.0%
40
fname = name;
40.000 s0.0%
16
fname = '';
80.000 s0.0%
17
extension = '';
80.000 s0.0%
Other lines & overhead  0.031 s99.9%
Totals  0.031 s100% 
Children (called functions)

Function NameFunction TypeCallsTotal Time% TimeTime Plot
ispcM-function80 s0%
filesepM-function80 s0%
Self time (built-ins, overhead, etc.)  0.031 s100.0%
Totals  0.031 s100% 
M-Lint results
Line numberMessage
23The value assigned here to variable 'n' might never be used.
74Use FIND with the new 'first' or 'last' option.
Coverage results
[ Show coverage for parent directory ]
Total lines in file86
Non-code lines (comments, blank lines)35
Code lines (lines that can run)51
Code lines that did run31
Code lines that did not run20
Coverage (did run/can run)60.78 %
Function listing
   time   calls  line
1 function [path, fname, extension,version] = fileparts(name)
2 %FILEPARTS Filename parts.
3 % [PATHSTR,NAME,EXT,VERSN] = FILEPARTS(FILE) returns the path,
4 % filename, extension and version for the specified file.
5 % FILEPARTS is platform dependent.
6 %
7 % You can reconstruct the file from the parts using
8 % fullfile(pathstr,[name ext versn])
9 %
10 % See also FULLFILE, PATHSEP, FILESEP.
11
12 % Copyright 1984-2004 The MathWorks, Inc.
13 % $Revision: 1.18.4.3 $ $Date: 2005/03/18 22:43:39 $
14
< 0.01 8 15 path = '';
< 0.01 8 16 fname = '';
< 0.01 8 17 extension = '';
< 0.01 8 18 version = '';
19
< 0.01 8 20 if isempty(name), return, end
21
22 % Nothing but a row vector should be operated on.
< 0.01 8 23 [m,n] = size(name);
8 24 if (m > 1)
25 error('Input cannot be a padded string matrix.');
26 end
27
8 28 if strncmp(name, xlate('built-in'), size(xlate('built-in'),2))
29 fname = xlate('built-in');
30 return;
31 end
32
8 33 if ispc
< 0.01 8 34 orig_name = name;
35
36 % Convert all / to \ on PC
8 37 name = strrep(name,'/','\');
8 38 ind = find(name == filesep | name == ':');
8 39 if isempty(ind)
< 0.01 4 40 fname = name;
4 41 else
42 %special case for drive
4 43 if name(ind(end)) == ':'
44 path = orig_name(1:ind(end));
4 45 elseif isequal(ind,[1 2]) ...
46 && name(ind(1)) == filesep && name(ind(2)) == filesep
47 %special case for UNC server
48 path = orig_name;
49 ind(end) = length(orig_name);
< 0.01 4 50 else
4 51 path = orig_name(1:ind(end)-1);
4 52 end
4 53 if ~isempty(path) && path(end)==':'
54 path = [path '\'];
55 end
4 56 fname = name(ind(end)+1:end);
4 57 end
58 else % UNIX
59 ind = find(name == filesep);
60 if isempty(ind)
61 fname = name;
62 else
63 path = name(1:ind(end)-1);
64
65 % Do not forget to add filesep when in the root filesystem
66 if isempty(deblank(path)), path = [path filesep]; end
67 fname = name(ind(end)+1:end);
68 end
69 end
70
< 0.01 8 71 if isempty(fname), return, end
72
73 % Look for EXTENSION part
8 74 ind = max(find(fname == '.'));
75
8 76 if isempty(ind)
6 77 return
2 78 else
2 79 extension = fname(ind:end);
2 80 fname(ind:end) = [];
81
82 % Make sure name does not have two consecutive dots - m-file's won't reload
83 % if strcmp(fname(end), '.') & strcmp(extension(1), '.')
84 % error( [ 'Invalid filename: ' name ] );
85 % end
2 86 end