This is a static copy of a profile report

Home

mustBeLessThanOrEqual (Calls: 1, Time: 0.000 s)
Generated 18-May-2021 16:05:26 using performance time.
function in file /usr/local/MATLAB/R2021a/toolbox/matlab/validators/mustBeLessThanOrEqual.m
Copy to new window for comparing multiple runs

Parents (calling functions)

Function NameFunction TypeCalls
...lugin>PostUpdatePlugin.doCacheLoadclass method1
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
35
if ~all(A(:) <= B)
10.000 s31.4%
15
if ~isscalar(B)
10.000 s16.9%
19
if ~isnumeric(B) && ~i...
10.000 s9.3%
27
if ~isreal(B)
10.000 s8.1%
23
if ~isnumeric(A) && ~i...
10.000 s4.7%
All other lines  0.000 s29.7%
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 function41
Non-code lines (comments, blank lines)21
Code lines (lines that can run)20
Code lines that did run13
Code lines that did not run7
Coverage (did run/can run)65.00 %
Function listing
time 
Calls 
 line
   1 
function mustBeLessThanOrEqual(A, B)
   2 
%MUSTBELESSTHANOREQUAL Validate that value is less than or equal to a specified value
   3 
%   MUSTBELESSTHANOREQUAL(A,B) throws an error if A is not less than or equal to B.
   4 
%   MATLAB calls le to determine if A is less than or equal to B.
   5 
%
   6 
%   Class support:
   7 
%   All numeric classes, logical
   8 
%   MATLAB classes that define these methods:
   9 
%       le, isscalar, isreal, isnumeric, islogical
  10 
%
  11 
%   See also: MUSTBENUMERICORLOGICAL, MUSTBEREAL.
  12 
    
  13 
%   Copyright 2016-2020 The MathWorks, Inc.
  14 

< 0.001 
      1 
  15
    if ~isscalar(B) 
  16 
        throwAsCaller(createValidatorException('MATLAB:validatorUsage:nonScalarSecondInput', 'mustBeLessThanOrEqual'));
< 0.001 
      1 
  17
    end 
  18 
    
< 0.001 
      1 
  19
    if ~isnumeric(B) && ~islogical(B) 
  20 
        throwAsCaller(createValidatorException('MATLAB:validatorUsage:nonNumericOrLogicalInput', 'mustBeLessThanOrEqual'));
< 0.001 
      1 
  21
    end 
  22 
    
< 0.001 
      1 
  23
    if ~isnumeric(A) && ~islogical(A) 
  24 
        throwAsCaller(createValidatorException('MATLAB:validators:mustBeNumericOrLogical'));
< 0.001 
      1 
  25
    end 
  26 
    
< 0.001 
      1 
  27
    if ~isreal(B) 
  28 
        throwAsCaller(createValidatorException('MATLAB:validatorUsage:nonRealInput', 'mustBeLessThanOrEqual'));
< 0.001 
      1 
  29
    end 
  30 

< 0.001 
      1 
  31
    if ~isreal(A) 
  32 
        throwAsCaller(createValidatorException('MATLAB:validators:mustBeReal'));
< 0.001 
      1 
  33
    end 
  34 
    
< 0.001 
      1 
  35
    if ~all(A(:) <= B) 
  36 
        throwAsCaller(createValidatorExceptionWithValue(...
  37 
            createPrintableScalar(B),...
  38 
            'MATLAB:validators:mustBeLessThanOrEqualGenericText',...
  39 
            'MATLAB:validators:mustBeLessThanOrEqual'));
< 0.001 
      1 
  40
    end 
< 0.001 
      1 
  41
end 

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