This is a static copy of a profile report

Home

distchck (Calls: 9, Time: 0.002 sec)
Generated 28-May-2016 14:58:47 using performance time.
function in file /home/johs/MATLAB/R2015b/toolbox/stats/stats/distchck.m
Copy to new window for comparing multiple runs

Parents (calling functions)

Function NameFunction TypeCalls
chi2invfunction9
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
15
scalar = cellfun( @isscalar, v...
90.001 s43.9%
18
if (all(scalar)), return; end
90.001 s26.6%
10
if nparms == 1
90.000 s0.3%
7
errorcode = 0;
90.000 s0.2%
8
varargout = varargin;
90.000 s0.0%
All other lines  0.001 s28.9%
Totals  0.002 s100% 
Children (called functions)
No children
Code Analyzer results
No Code Analyzer messages.
Coverage results
Show coverage for parent directory
Total lines in function42
Non-code lines (comments, blank lines)15
Code lines (lines that can run)27
Code lines that did run5
Code lines that did not run22
Coverage (did run/can run)18.52 %
Function listing
time 
Calls 
 line
   1 
function [errorcode,varargout] = distchck(nparms,varargin)
   2 
%DISTCHCK Checks the argument list for the probability functions.
   3 

   4 
%   Copyright 1993-2014 The MathWorks, Inc. 
   5 

   6 

< 0.01 
      9 
   7 
errorcode = 0; 
< 0.01 
      9 
   8 
varargout = varargin; 
   9 

< 0.01 
      9 
  10 
if nparms == 1 
  11 
    return;
  12 
end
  13 

  14 
% Get size of each input, check for scalars, copy to output
< 0.01 
      9 
  15 
scalar = cellfun( @isscalar, varargin ); 
  16 

  17 
% Done if all inputs are scalars.  Otherwise fetch their common size.
< 0.01 
      9 
  18 
if (all(scalar)), return; end 
  19 

  20 
n = nparms;
  21 

  22 
sz = cellfun( @size, varargin, 'UniformOutput', false );
  23 
t = sz(~scalar);
  24 
size1 = t{1};
  25 

  26 
% Scalars receive this size.  Other arrays must have the proper size.
  27 
for j=1:n
  28 
   sizej = sz{j};
  29 
   if (scalar(j))
  30 
      vj = varargin{j};
  31 
      if isnumeric(vj)
  32 
         t = zeros(size1,'like',vj);
  33 
      else
  34 
         t = zeros(size1);
  35 
      end
  36 
      t(:) = vj;
  37 
      varargout{j} = t;
  38 
   elseif (~isequal(sizej,size1))
  39 
      errorcode = 1;
  40 
      return;
  41 
   end
  42 
end