This is a static copy of a profile report

Home

linspace (84 calls, 0.000 sec)
Generated 14-Nov-2016 07:47:10 using cpu time.
function in file /usr/local/MATLAB/MATLAB_Production_Server/R2015a/toolbox/matlab/elmat/linspace.m
Copy to new window for comparing multiple runs

Parents (calling functions)

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

Line NumberCodeCallsTotal Time% TimeTime Plot
35
end
840 s0%
34
y(end) = d2;
840 s0%
33
y(1) = d1;
840 s0%
32
if ~isempty(y)
840 s0%
31
end
840 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 

     84 
  16 
if nargin == 2 
  17 
    n = 100;
     84 
  18 
else 
     84 
  19 
    n = floor(double(n)); 
     84 
  20 
end 
     84 
  21 
n1 = n-1; 
     84 
  22 
c = (d2 - d1).*(n1-1); %check intermediate value for appropriate treatment 
     84 
  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
     84 
  29 
else 
     84 
  30 
    y = d1 + (0:n1).*(d2 - d1)/n1; 
     84 
  31 
end 
     84 
  32 
if ~isempty(y) 
     84 
  33 
    y(1) = d1; 
     84 
  34 
    y(end) = d2; 
     84 
  35 
end