This is a static copy of a profile report

Home

mustBeNonnegative (Calls: 2, Time: 0.000 s)
Generated 04-Jun-2021 04:11:11 using performance time.
function in file C:\Program Files\MATLAB\R2020b\toolbox\matlab\validators\mustBeNonnegative.m
Copy to new window for comparing multiple runs

Parents (calling functions)

Function NameFunction TypeCalls
FastVarOpts>FastVarOpts.FastVarOptsclass method2
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
23
if ~all(A >= 0, 'all')
20.000 s27.7%
26
end
20.000 s0.4%
15
if ~isnumeric(A) && ~i...
20.000 s0.1%
19
if ~isreal(A)
20.000 s0.1%
25
end
20.000 s0.1%
All other lines  0.000 s71.5%
Totals  0.000 s100% 
Children (called functions)
No children
Code Analyzer results
No Code Analyzer messages.
Coverage results
Show coverage for parent directory
Total lines in function26
Non-code lines (comments, blank lines)16
Code lines (lines that can run)10
Code lines that did run7
Code lines that did not run3
Coverage (did run/can run)70.00 %
Function listing
time 
Calls 
 line
   1 
function mustBeNonnegative(A)
   2 
%MUSTBENONNEGATIVE Validate that value is nonnegative
   3 
%   MUSTBENONNEGATIVE(A) throws an error if A contains negaitive values.
   4 
%   A value is nonnegative if it is greater than or equal to zero.
   5 
%
   6 
%   Class support:
   7 
%   All numeric classes, logical
   8 
%   MATLAB classes that define these methods:
   9 
%       ge, isreal, isnumeric, islogical
  10 
%
  11 
%   See also: MUSTBENUMERICORLOGICAL, MUSTBEREAL.
  12 
    
  13 
%   Copyright 2016-2020 The MathWorks, Inc.
  14 

< 0.001 
      2 
  15
    if ~isnumeric(A) && ~islogical(A) 
  16 
        throwAsCaller(createValidatorException('MATLAB:validators:mustBeNumericOrLogical'));
< 0.001 
      2 
  17
    end 
  18 
    
< 0.001 
      2 
  19
    if ~isreal(A) 
  20 
        throwAsCaller(createValidatorException('MATLAB:validators:mustBeReal'));
< 0.001 
      2 
  21
    end 
  22 

< 0.001 
      2 
  23
    if ~all(A >= 0, 'all') 
  24 
        throwAsCaller(createValidatorException('MATLAB:validators:mustBeNonnegative'));
< 0.001 
      2 
  25
    end 
< 0.001 
      2 
  26
end 

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