This is a static copy of a profile report

Home

Function details for snapnow>leavingCellThis is a static copy of a profile report

Home

snapnow>leavingCell (Calls: 5, Time: 0.159 s)
Generated 28-Jun-2020 10:10:21 using performance time.
subfunction in file /Applications/MATLAB_R2018a.app/toolbox/matlab/codetools/snapnow.m
Copy to new window for comparing multiple runs

Parents (calling functions)

Function NameFunction TypeCalls
snapnowfunction5
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
197
newFiles = data.plugins(iPlugi...
50.087 s54.4%
193
(exist(data.plugins(iPlugins)....
50.068 s42.6%
192
if data.plugins(iPlugins).chec...
100.002 s1.3%
188
fprintf('%s%iZ%iX',data.marker...
50.001 s0.6%
194
if isempty(data.plugins(iPlugi...
50.001 s0.3%
All other lines  0.001 s0.8%
Totals  0.159 s100% 
Children (called functions)

Function NameFunction TypeCallsTotal Time% TimeTime Plot
...Figures>PublishFigures.leavingCellclass method50.086 s53.8%
snapnow>hasSimulinksubfunction50.001 s0.9%
snapnow>makeCounter/getCounternested function50.000 s0.2%
Self time (built-ins, overhead, etc.)  0.072 s45.1%
Totals  0.159 s100% 
Code Analyzer results
No Code Analyzer messages.
Coverage results
Show coverage for parent directory
Total lines in function47
Non-code lines (comments, blank lines)7
Code lines (lines that can run)40
Code lines that did run12
Code lines that did not run28
Coverage (did run/can run)30.00 %
Function listing
time 
Calls 
 line
 185 
function data = leavingCell(iCell, data, doCapture)
 186 

 187 
% Leave a divider in the output stream.
  0.001 
      5 
 188
fprintf('%s%iZ%iX',data.marker,iCell,data.counter()) 
 189 

< 0.001 
      5 
 190
if doCapture 
< 0.001 
      5 
 191
    for iPlugins = 1:numel(data.plugins) 
  0.070 
     10 
 192
        if data.plugins(iPlugins).check() && ... 
      5 
 193
                (exist(data.plugins(iPlugins).classname,'class') == 8) 
< 0.001 
      5 
 194
            if isempty(data.plugins(iPlugins).instance) 
 195 
                data.plugins(iPlugins).instance = feval(data.plugins(iPlugins).classname,data.options);
 196 
            end
  0.087 
      5 
 197
            newFiles = data.plugins(iPlugins).instance.leavingCell(iCell); 
< 0.001 
      5 
 198
            for iNewFiles = 1:numel(newFiles) 
 199 
                if isfield(data,'append')
 200 
                    % Undocumented prototype code for creating animated GIFs.
 201 
                    X = imread(newFiles{iNewFiles});
 202 
                    delete(newFiles{iNewFiles})
 203 
                    [im,map] = rgb2ind(X,512,'nodither');
 204 
                    gifExists = numel(data.pictureList) > 0 && ...
 205 
                        ~isempty(regexp(data.pictureList{end},'\.gif$','once'));
 206 
                    if gifExists
 207 
                        if isinf(data.append)
 208 
                            imwrite(im,map,data.pictureList{end},'gif', ...
 209 
                                'WriteMode','append');
 210 
                        else
 211 
                            imwrite(im,map,data.pictureList{end},'gif', ...
 212 
                                'WriteMode','append','DelayTime',data.append);
 213 
                        end
 214 
                    else
 215 
                        newFilename = regexprep(newFiles{iNewFiles},'\.\w+$','.gif');
 216 
                        imwrite(im,map,newFilename,'gif','LoopCount',Inf);
 217 
                        data.pictureList{end+1} = newFilename;
 218 
                        data.placeList(end+1) = iCell;
 219 
                        data.placeList(end+1) = data.counter();
 220 
                    end
 221 
                else
 222 
                    data.pictureList{end+1} = newFiles{iNewFiles};
 223 
                    data.placeList(end+1) = iCell;
 224 
                    data.placeList(end+1) = data.counter();
 225 
                end
 226 
            end
< 0.001 
      5 
 227
        end 
< 0.001 
     10 
 228
    end     
< 0.001 
      5 
 229
end 
 230 

< 0.001 
      5 
 231
end 

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