This is a static copy of a profile report

Home

Function details for distchckThis is a static copy of a profile report

Home

distchck (Calls: 4, Time: 0.003 s)
Generated 03-Jul-2019 20:30:06 using performance time.
function in file C:\Program Files\MATLAB\R2019a\toolbox\stats\stats\distchck.m
Copy to new window for comparing multiple runs

Parents (calling functions)

Function NameFunction TypeCalls
binopdffunction4
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
28
sizej = sz{j};
120.001 s15.6%
32
t = zeros(size1,'like',vj);
80.000 s12.7%
27
for j=1:n
40.000 s8.5%
42
end
120.000 s8.0%
29
if (scalar(j))
120.000 s7.7%
All other lines  0.002 s47.5%
Totals  0.003 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 run20
Code lines that did not run7
Coverage (did run/can run)74.07 %
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.001 
      4 
   7
errorcode = 0; 
< 0.001 
      4 
   8
varargout = varargin; 
   9 

< 0.001 
      4 
  10
if nparms == 1 
  11 
    return;
  12 
end
  13 

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

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

< 0.001 
      4 
  20
n = nparms; 
  21 

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

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

Other subfunctions in this file are not included in this listing.