This is a static copy of a profile reportHome
linspace (2626 calls, 0.481 sec)
Generated 05-Nov-2014 07:52:39 using cpu time.
function in file /usr1/opt/matlab/7.13/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 |
29 | y = [d1 + vec.*(d2 - d1)/n1, d... | 2626 | 0.320 s | 66.7% |  |
22 | vec = 0:n-2; | 2626 | 0.070 s | 14.6% |  |
17 | if nargin == 2 | 2626 | 0.020 s | 4.2% |  |
30 | end | 2626 | 0.010 s | 2.1% |  |
28 | else | 2626 | 0.010 s | 2.1% |  |
All other lines | | | 0.050 s | 10.4% |  |
Totals | | | 0.481 s | 100% | |
Children (called functions)
No childrenCode Analyzer results
No Code Analyzer messages.Coverage results
[ Show coverage for parent directory ]
Total lines in function | 30 |
Non-code lines (comments, blank lines) | 16 |
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 = 1, 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-2011 The MathWorks, Inc.
15 % $Revision: 5.12.4.6 $ $Date: 2011/05/17 02:22:58 $
16
0.02 2626 17 if nargin == 2
18 n = 100;
19 end
0.01 2626 20 n = double(n);
0.01 2626 21 n1 = floor(n)-1;
0.07 2626 22 vec = 0:n-2;
2626 23 c = (d2 - d1).*(n-2);
2626 24 if n < 1
25 y = zeros(1, 0, superiorfloat(d1, d2));
2626 26 elseif isinf(c)
27 y = [d1 + (d2/n1).*vec - (d1/n1).*vec, d2]; % overflow for d1 < 0 and d2 > 0
0.01 2626 28 else
0.32 2626 29 y = [d1 + vec.*(d2 - d1)/n1, d2];
0.01 2626 30 end