This is a static copy of a profile report

Home

xyzchk (189 calls, 2.303 sec)
Generated 05-Nov-2014 07:52:39 using cpu time.
function in file /usr1/opt/matlab/7.13/toolbox/matlab/polyfun/xyzchk.m
Copy to new window for comparing multiple runs

Parents (calling functions)

Function NameFunction TypeCalls
interp2function189
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
49
[x,y] = meshgrid(x,y);
1892.243 s97.4%
95
if automesh(xi,yi),
1890.030 s1.3%
93
xi = arg4; yi = arg5;
1890.010 s0.4%
48
if isvector(x) && isve...
1890.010 s0.4%
101
end
1890 s0%
All other lines  0.010 s0.4%
Totals  2.303 s100% 
Children (called functions)

Function NameFunction TypeCallsTotal Time% TimeTime Plot
meshgridfunction1892.223 s96.5%
automeshfunction1890.020 s0.9%
xyzchk>isvectorsubfunction5670.010 s0.4%
Self time (built-ins, overhead, etc.)  0.050 s2.2%
Totals  2.303 s100% 
Code Analyzer results
No Code Analyzer messages.
Coverage results
[ Show coverage for parent directory ]
Total lines in function101
Non-code lines (comments, blank lines)23
Code lines (lines that can run)78
Code lines that did run24
Code lines that did not run54
Coverage (did run/can run)30.77 %
Function listing
   time   calls  line
1 function [msg,x,y,z,out5,out6] = xyzchk(arg1,arg2,arg3,arg4,arg5)
2 %XYZCHK Check arguments to 3-D data routines.
3 % [MSG,X,Y,Z,C] = XYZCHK(Z), or
4 % [MSG,X,Y,Z,C] = XYZCHK(Z,C), or
5 % [MSG,X,Y,Z,C] = XYZCHK(X,Y,Z), or
6 % [MSG,X,Y,Z,C] = XYZCHK(X,Y,Z,C), or
7 % [MSG,X,Y,Z,XI,YI] = XYZCHK(X,Y,Z,XI,YI) checks the input arguments
8 % and returns either an error message in MSG or valid X,Y,Z (and
9 % XI,YI) data.
10
11 % Copyright 1984-2009 The MathWorks, Inc.
12 % $Revision: 5.17.4.4 $ $Date: 2009/03/16 22:18:23 $
13
189 14 error(nargchk(1,6,nargin,'struct'));
15
189 16 msg.message = 0;
189 17 msg.identifier = 0;
189 18 msg = msg(zeros(0,1));
19
189 20 out5 = []; out6 = [];
189 21 if nargin==1, % xyzchk(z)
22 z = arg1;
23 if ischar(z),
24 msg = makeMsg('nonNumericInput', 'Input arguments must be numeric.');
25 return
26 end
27 [m,n] = size(z);
28 [x,y] = meshgrid(1:n,1:m);
29 out5 = z; % Default color matrix
30 return
31
189 32 elseif nargin==2, % xyzchk(z,c)
33 z = arg1; c = arg2;
34 [m,n] = size(z);
35 [x,y] = meshgrid(1:n,1:m);
36 if ~isequal(size(z),size(c)),
37 msg = makeMsg('CAndZSizeMismatch', 'Matrix C must be the same size as Z.');
38 return
39 end
40 out5 = c;
41 return
42
189 43 elseif nargin>=3, % xyzchk(x,y,z,...)
189 44 x = arg1; y = arg2; z = arg3;
189 45 [m,n] = size(z);
189 46 if ~isvector(z), % z is a matrix
47 % Convert x,y to row and column matrices if necessary.
0.01 189 48 if isvector(x) && isvector(y),
2.24 189 49 [x,y] = meshgrid(x,y);
189 50 if size(x,2)~=n && size(y,1)~=m,
51 msg = makeMsg('lengthXAndYDoNotMatchSizeZ', 'The lengths of X and Y must match the size of Z.');
52 return
189 53 elseif size(x,2)~=n,
54 msg = makeMsg('lengthXDoesNotMatchNumColumnsZ', 'The length of X must match the number of columns of Z.');
55 return
189 56 elseif size(y,1)~=m,
57 msg = makeMsg('lengthYDoesNotMatchNumRowsZ', 'The length of Y must match the number of rows of Z.');
58 return
59 end
60 elseif isvector(x) || isvector(y),
61 msg = makeMsg('XAndYShapeMismatch', 'X and Y must both be vectors or both be matrices.');
62 return
63 else
64 if ~isequal(size(x),size(y),size(z)),
65 msg = makeMsg('XYAndZSizeMismatch', 'Matrices X and Y must be the same size as Z.');
66 return
67 end
68 end
69 else % z is a vector
70 if ~isvector(x) || ~isvector(y),
71 msg = makeMsg('XYAndZShapeMismatch', 'When Z is a vector, X and Y must also be vectors.');
72 return
73 elseif (length(x)~=length(z) || length(y)~=length(z)) && ...
74 ~((length(x)==size(z,2)) && (length(y)==size(z,1)))
75 msg = makeMsg('XYAndZLengthMismatch', sprintf(['X and Y must be same length as Z or the lengths \n', ...
76 'of X and Y must match the size of Z.']));
77 return
78 end
79 end
189 80 end
81
189 82 if nargin==4, % xyzchk(x,y,z,c)
83 c = arg4;
84 if ~isequal(size(z),size(c))
85 msg = makeMsg('CAndZSizeMismatch', 'Matrix C must be the same size as Z.');
86 return
87 end
88 out5 = c;
89 return
90 end
91
189 92 if nargin==5, % xyzchk(x,y,z,xi,yi)
0.01 189 93 xi = arg4; yi = arg5;
94
0.03 189 95 if automesh(xi,yi),
96 [xi,yi] = meshgrid(xi,yi);
189 97 elseif ~isequal(size(xi),size(yi)),
98 msg = makeMsg('XIAndYISizeMismatch', 'XI and YI must be the same size or vectors of different orientations.');
99 end
189 100 out5 = xi; out6 = yi;
189 101 end

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