This is a static copy of a profile report

Home

linspace (150 calls, 1.683 sec)
Generated 05-Aug-2011 13:03:12 using cpu time.
function in file /usr/local/MATLAB/R2011a/toolbox/matlab/elmat/linspace.m
Copy to new window for comparing multiple runs

Parents (calling functions)

Function NameFunction TypeCalls
filter_datafunction72
plot_powerspecfunction66
scribe.legend.methods>localGetLineDatasubfunction12
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
30
y = [d1 + vec.*d2md1/n1, d2];
1501.399 s83.1%
22
vec = 0:n-2;
1500.197 s11.7%
31
end
1500.011 s0.6%
27
elseif isinf(d2md1.*(n-2))
1500.011 s0.6%
29
else
1500 s0%
All other lines  0.066 s3.9%
Totals  1.683 s100% 
Children (called functions)
No children
Code Analyzer results
No Code Analyzer messages.
Coverage results
[ Show coverage for parent directory ]
Total lines in function31
Non-code lines (comments, blank lines)17
Code lines (lines that can run)14
Code lines that did run10
Code lines that did not run4
Coverage (did run/can run)71.43 %
Function listing
   time   calls  line
1 function y = linspace(d1, d2, n)
2 %LINSPACE Linearly spaced vector.
3 % LINSPACE(X1, X2) generates a row vector of 100 linearly
4 % equally spaced points between X1 and X2.
5 %
6 % LINSPACE(X1, X2, N) generates N points between X1 and X2.
7 % For N < 2, LINSPACE returns X2.
8 %
9 % Class support for inputs X1,X2:
10 % float: double, single
11 %
12 % See also LOGSPACE, COLON.
13
14 % Copyright 1984-2010 The MathWorks, Inc. a
15 % $Revision: 5.12.4.4 $ $Date: 2010/11/22 02:46:00 $
16
150 17 if nargin == 2
18 n = 100;
19 end
150 20 n = double(n);
150 21 n1 = floor(n)-1;
0.20 150 22 vec = 0:n-2;
150 23 d2md1 = d2 - d1;
24
150 25 if n < 1
26 y = zeros(1, 0, superiorfloat(d1, d2));
0.01 150 27 elseif isinf(d2md1.*(n-2))
28 y = [d1 + (d2/n1).*vec - (d1/n1).*vec, d2]; % overflow for d1 < 0 and d2 > 0
150 29 else
1.40 150 30 y = [d1 + vec.*d2md1/n1, d2];
0.01 150 31 end