This is a static copy of a profile report

Home

imagesc (Calls: 2, Time: 0.132 s)
Generated 16-Jul-2020 17:08:46 using performance time.
function in file /Applications/MATLAB_R2020a.app/toolbox/matlab/specgraph/imagesc.m
Copy to new window for comparing multiple runs

Parents (calling functions)

Function NameFunction TypeCalls
OC3function2
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
52
hh = image(varargin{:}, 'CData...
20.128 s96.3%
60
elseif any(strcmpi(cax.NextPlo...
20.001 s0.7%
23
if nargin >= 1 && i...
20.001 s0.6%
61
set(cax,'CLimMode','auto')
20.001 s0.5%
56
cax = ancestor(hh,'axes');
20.001 s0.5%
All other lines  0.002 s1.4%
Totals  0.132 s100% 
Children (called functions)

Function NameFunction TypeCallsTotal Time% TimeTime Plot
newplotimagewrapperfunction20.122 s91.9%
Self time (built-ins, overhead, etc.)  0.011 s8.1%
Totals  0.132 s100% 
Code Analyzer results
No Code Analyzer messages.
Coverage results
Show coverage for parent directory
Total lines in function66
Non-code lines (comments, blank lines)31
Code lines (lines that can run)35
Code lines that did run20
Code lines that did not run15
Coverage (did run/can run)57.14 %
Function listing
time 
Calls 
 line
   1 
function h = imagesc(varargin)
   2 
%IMAGESC Display image with scaled colors
   3 
%   IMAGESC(...) is the same as IMAGE(...) except the data is scaled
   4 
%   to use the full colormap.
   5 
%
   6 
%   IMAGESC(...,CLIM) where CLIM = [CLOW CHIGH] can specify the
   7 
%   scaling.
   8 
%
   9 
%   See also IMSHOW, IMAGE, COLORBAR, IMREAD, IMWRITE.
  10 

  11 
%   Copyright 1984-2018 The MathWorks, Inc.
  12 

  13 
import matlab.graphics.internal.*;
  14 

  15 

< 0.001 
      2 
  16
clim = []; 
< 0.001 
      2 
  17
if nargin == 0 
  18 
    % Really no args.  Just add CDataMapping.
  19 
    hh = image('CDataMapping', 'scaled');
< 0.001 
      2 
  20
else 
< 0.001 
      2 
  21
    checkArgs = varargin; 
  22 
    % Check to see if the first argument is a handle.
< 0.001 
      2 
  23
    if nargin >= 1 && isa(varargin{1}, 'matlab.graphics.Graphics') 
  24 
        % Remove this arg for the sake of examining inputs.
  25 
        checkArgs(1) = [];
< 0.001 
      2 
  26
    end 
< 0.001 
      2 
  27
    nCheckArgs = length(checkArgs); 
< 0.001 
      2 
  28
    if nCheckArgs > 1 
  29 
        % Determine if last input is clim
< 0.001 
      2 
  30
        if isequal(size(checkArgs{end}),[1 2]) 
  31 
            % Last input is 1x2 vector.  Might be clims.
  32 
            
  33 
            % Look for param/value pairs.
  34 
            str = false(length(checkArgs),1);
  35 
            for n=1:length(checkArgs)
  36 
                str(n) = isCharOrString(checkArgs{n});
  37 
            end
  38 
            str = find(str);
  39 
            if ~(isempty(str) && nCheckArgs == 3)
  40 
                % We are not in the imagesc(x, y, C) case.
  41 
                if isempty(str) || (rem(length(checkArgs)-min(str),2)==0)
  42 
                    % There were no param / value pairs, or there were and
  43 
                    % the last arg was not part of one.
  44 
                    % Remove clims from original arg list.
  45 
                    clim = varargin{end};
  46 
                    varargin(end) = []; % Remove last cell
  47 
                end
  48 
            end
< 0.001 
      2 
  49
        end 
< 0.001 
      2 
  50
    end 
  51 
    
  0.128 
      2 
  52
    hh = image(varargin{:}, 'CDataMapping', 'scaled'); 
< 0.001 
      2 
  53
end 
  54 

  55 
% Get the parent Axes of the image
< 0.001 
      2 
  56
cax = ancestor(hh,'axes'); 
  57 

< 0.001 
      2 
  58
if ~isempty(clim) 
  59 
    set(cax,'CLim',clim)
< 0.001 
      2 
  60
elseif any(strcmpi(cax.NextPlot,{'replaceall','replace'})) 
< 0.001 
      2 
  61
    set(cax,'CLimMode','auto') 
< 0.001 
      2 
  62
end 
  63 

< 0.001 
      2 
  64
if nargout > 0 
  65 
    h = hh;
< 0.001 
      2 
  66
end 

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