This is a static copy of a profile report

Home

linspace (6 calls, 0.000 sec)
Generated 04-Aug-2014 13:05:14 using cpu time.
function in file /share/apps/matlabr2014a/toolbox/matlab/elmat/linspace.m
Copy to new window for comparing multiple runs

Parents (calling functions)

Function NameFunction TypeCalls
meshdomainfunction6
Lines where the most time was spent
No measurable time spent in this function

Line NumberCodeCallsTotal Time% TimeTime Plot
35
end
60 s0%
34
y(end) = d2;
60 s0%
33
y(1) = d1;
60 s0%
32
if ~isempty(y)
60 s0%
31
end
60 s0%
All other lines  0 s0%
Totals  0 s0% 
Children (called functions)
No children
Code Analyzer results
No Code Analyzer messages.
Coverage results
Show coverage for parent directory
Total lines in function35
Non-code lines (comments, blank lines)15
Code lines (lines that can run)20
Code lines that did run14
Code lines that did not run6
Coverage (did run/can run)70.00 %
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-2013 The MathWorks, Inc.
  15 

      6 
  16 
if nargin == 2 
  17 
    n = 100;
      6 
  18 
else 
      6 
  19 
    n = floor(double(n)); 
      6 
  20 
end 
      6 
  21 
n1 = n-1; 
      6 
  22 
c = (d2 - d1).*(n1-1); %check intermediate value for appropriate treatment 
      6 
  23 
if isinf(c) 
  24 
    if isinf(d2 - d1) %opposite signs overflow
  25 
        y = d1 + (d2/n1).*(0:n1) - (d1/n1).*(0:n1);
  26 
    else 
  27 
        y = d1 + (0:n1).*((d2 - d1)/n1);
  28 
    end
      6 
  29 
else 
      6 
  30 
    y = d1 + (0:n1).*(d2 - d1)/n1; 
      6 
  31 
end 
      6 
  32 
if ~isempty(y) 
      6 
  33 
    y(1) = d1; 
      6 
  34 
    y(end) = d2; 
      6 
  35 
end