This is a static copy of a profile reportHome
generateArgumentDescriptor (2 calls, 0.000 sec)
Generated 05-Nov-2014 07:53:12 using cpu time.
function in file /usr1/opt/matlab/7.13/toolbox/matlab/lang/+matlab/+internal/+validators/generateArgumentDescriptor.m
Copy to new window for comparing multiple runs
Parents (calling functions)
Lines where the most time was spent
No measurable time spent in this functionLine Number | Code | Calls | Total Time | % Time | Time Plot |
85 | end | 2 | 0 s | 0% |  |
76 | end | 2 | 0 s | 0% |  |
75 | argDescriptor = argname; | 2 | 0 s | 0% |  |
74 | else | 2 | 0 s | 0% |  |
72 | if isempty( argname ) | 2 | 0 s | 0% |  |
All other lines | | | 0 s | 0% |  |
Totals | | | 0 s | 0% | |
Children (called functions)
No childrenCode Analyzer results
No Code Analyzer messages.Coverage results
[ Show coverage for parent directory ]
Total lines in function | 85 |
Non-code lines (comments, blank lines) | 30 |
Code lines (lines that can run) | 55 |
Code lines that did run | 22 |
Code lines that did not run | 33 |
Coverage (did run/can run) | 40.00 % |
Function listing
time calls line
1 function [ fname, argDescriptor ] = generateArgumentDescriptor( inputs, callingFunc )
2 ; %#ok<NOSEM> % Undocumented
3
4 % Copyright 2011 The MathWorks, Inc.
5 % $Revision: 1.1.6.1 $ $Date: 2011/04/16 06:39:30 $
6
7 % initialize optional inputs to default values
2 8 fname = '';
2 9 argname = '';
2 10 argpos = [];
11
2 12 if numel( inputs ) > 0
13 % Try to disambiguate between user specifying argument position or
14 % function name as the fourth input
2 15 if numel( inputs ) == 1
16 if isa( inputs{1}, 'double' )
17 if ~isscalar( inputs{1} )
18 error( matlab.internal.validators.generateId( callingFunc, 'badFunctionName' ), ...
19 'Fourth argument must be a string to specify function name, or a scalar double to specify argument position.' )
20 elseif ~isfinite(inputs{1}) || ~(floor(inputs{1})==inputs{1}) || inputs{1} < 1
21 error( matlab.internal.validators.generateId( callingFunc, 'badArgPosition' ), ...
22 'ARGUMENT_POSITION must be a positive integer greater than 0.' )
23 end
24 elseif ~ischar( inputs{1} )
25 error( matlab.internal.validators.generateId( callingFunc, 'badFunctionName' ), ...
26 'Fourth argument must be a string to specify function name, or a scalar double to specify argument position.' )
27 end
2 28 else
2 29 if ~ischar( inputs{1} )
30 error( matlab.internal.validators.generateId( callingFunc, 'badFunctionNameString' ), ...
31 'Function name must be a string.' );
32 end
2 33 end
34
2 35 if ischar(inputs{1})
2 36 fname = inputs{1};
37 else
38 argpos = inputs{1};
39 end
2 40 end
41
2 42 if numel( inputs ) > 1
2 43 if ~ischar( inputs{2} )
44 error( matlab.internal.validators.generateId( callingFunc, 'badVariableName' ), ...
45 'VARIABLE_NAME must be a string.' )
46 end
47
2 48 argname = inputs{2};
2 49 end
50
2 51 if numel( inputs ) > 2
52 % cascade the checks to get specific error messages
53 if isnumeric(inputs{3}) && ...
54 ( isscalar(inputs{3}) || isempty(inputs{3}) )
55 % any empty is ok
56 if ~isempty(inputs{3}) && ...
57 (~isfinite(inputs{3}) || ~(floor(inputs{3})==inputs{3}) || inputs{3} < 1)
58 error( matlab.internal.validators.generateId( callingFunc, 'badArgPosition' ), ...
59 'ARGUMENT_POSITION must be a positive integer greater than 0.' )
60 end
61 else
62 error( matlab.internal.validators.generateId( callingFunc, 'badArgPositionClass' ), ...
63 'ARGUMENT_POSITION must be a numeric scalar or empty.' )
64 end
65
66 argpos = inputs{3};
67 end
68
69 % build the argument descriptor based on which inputs were specified
70 % by the user
2 71 if isempty( argpos )
2 72 if isempty( argname )
73 argDescriptor = 'input';
2 74 else
2 75 argDescriptor = argname;
2 76 end
77 else
78 if isempty( argname )
79 argDescriptor = sprintf( 'input number %d', argpos );
80 else
81 argDescriptor = sprintf( 'input number %d, %s,', argpos, argname );
82 end
83 end
84
2 85 end