This is a static copy of a profile reportHome
iptgetpref (3 calls, 0.016 sec)
Generated 15-Mar-2007 12:02:02 using real time.
M-function in file C:\Program Files\MATLAB71\toolbox\images\iptutils\iptgetpref.m
[Copy to new window for comparing multiple runs]
Parents (calling functions)
Lines where the most time was spent
Line Number | Code | Calls | Total Time | % Time | Time Plot |
29 | registryStruct = iptregistry; | 3 | 0.016 s | 100.0% |  |
31 | registryFieldNames = {}; | 3 | 0.000 s | 0.0% |  |
69 | end | 3 | 0 s | 0% |  |
68 | end | 3 | 0 s | 0% |  |
67 | value = factoryPrefs{matchIdx,... | 3 | 0 s | 0% |  |
Other lines & overhead | | | 0 s | 0% |  |
Totals | | | 0.016 s | 100% | |
Children (called functions)
M-Lint results
No M-Lint messages.Coverage results
[ Show coverage for parent directory ]
Total lines in file | 69 |
Non-code lines (comments, blank lines) | 34 |
Code lines (lines that can run) | 35 |
Code lines that did run | 17 |
Code lines that did not run | 18 |
Coverage (did run/can run) | 48.57 % |
Function listing
time calls line
1 function value = iptgetpref(prefName)
2 %IPTGETPREF Get Image Processing Toolbox preference.
3 % PREFS = IPTGETPREF without an input argument returns a structure
4 % containing all the Image Processing Toolbox preferences with their
5 % current values. Each field in the structure has the name of an Image
6 % Processing Toolbox preference. See IPTSETPREF for a list.
7 %
8 % VALUE = IPTGETPREF(PREFNAME) returns the value of the Image
9 % Processing Toolbox preference specified by the string PREFNAME. See
10 % IPTSETPREF for a complete list of valid preference names. Preference
11 % names are not case-sensitive and can be abbreviated.
12 %
13 % Example
14 % -------
15 % value = iptgetpref('ImshowAxesVisible')
16 %
17 % See also IMSHOW, IPTSETPREF.
18
19 % Copyright 1993-2004 The MathWorks, Inc.
20 % $Revision: 1.1.8.1 $ $Date: 2005/05/27 14:06:32 $
21
3 22 iptchecknargin(0,1,nargin,mfilename);
23
24 % Get IPT factory preference settings.
3 25 factoryPrefs = iptprefs;
3 26 allNames = factoryPrefs(:,1);
27
28 % What is currently stored in the IPT registry?
0.02 3 29 registryStruct = iptregistry;
3 30 if (isempty(registryStruct))
< 0.01 3 31 registryFieldNames = {};
32 else
33 registryFieldNames = fieldnames(registryStruct);
34 end
35
3 36 if (nargin == 0)
37 % Display all current preference settings.
38 value = [];
39 for k = 1:length(allNames)
40 thisField = allNames{k}{1};
41 registryContainsPreference = length(strmatch(thisField, ...
42 registryFieldNames, 'exact')) > 0;
43 if (registryContainsPreference)
44 value.(thisField) = registryStruct.(thisField);
45 elseif ~isempty(thisField)
46 % Use default value
47 value.(thisField) = factoryPrefs{k,3}{1};
48 end
49 end
50
3 51 else
52 % Return specified setting.
3 53 if (~isa(prefName, 'char'))
54 eid = sprintf('Images:%s:invalidPreferenceName',mfilename);
55 msg = 'Preference name must be a string.';
56 error(eid,'%s',msg);
57 end
58
3 59 matchIdx = iptcheckprefname(prefName,allNames);
3 60 preference = allNames{matchIdx}{1};
61
3 62 registryContainsPreference = length(strmatch(preference, ...
63 registryFieldNames, 'exact')) > 0;
3 64 if (registryContainsPreference)
65 value = registryStruct.(preference);
3 66 else
3 67 value = factoryPrefs{matchIdx, 3}{1};
3 68 end
3 69 end