This is a static copy of a profile reportHome
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)
Lines where the most time was spent
Line Number | Code | Calls | Total Time | % Time | Time Plot |
30 | y = [d1 + vec.*d2md1/n1, d2]; | 150 | 1.399 s | 83.1% |  |
22 | vec = 0:n-2; | 150 | 0.197 s | 11.7% |  |
31 | end | 150 | 0.011 s | 0.6% |  |
27 | elseif isinf(d2md1.*(n-2)) | 150 | 0.011 s | 0.6% |  |
29 | else | 150 | 0 s | 0% |  |
All other lines | | | 0.066 s | 3.9% |  |
Totals | | | 1.683 s | 100% | |
Children (called functions)
No childrenCode Analyzer results
No Code Analyzer messages.Coverage results
[ Show coverage for parent directory ]
Total lines in function | 31 |
Non-code lines (comments, blank lines) | 17 |
Code lines (lines that can run) | 14 |
Code lines that did run | 10 |
Code lines that did not run | 4 |
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