This is a static copy of a profile report

Home

categorical.countcats (Calls: 6, Time: 0.001 s)
Generated 04-Jun-2021 04:11:26 using performance time.
function in file C:\Program Files\MATLAB\R2020b\toolbox\matlab\datatypes\categorical\@categorical\countcats.m
Copy to new window for comparing multiple runs

Parents (calling functions)

Function NameFunction TypeCalls
script9script6
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
18
c = histc(a.codes,1:length(a.c...
60.000 s61.9%
17
if nargin < 2
60.000 s15.1%
21
end
60.000 s0.4%
All other lines  0.000 s22.5%
Totals  0.001 s100% 
Children (called functions)
No children
Code Analyzer results
Line numberMessage
18'histc' is not recommended. Use 'histcounts' instead.
20'histc' is not recommended. Use 'histcounts' instead.
Coverage results
Show coverage for parent directory
Total lines in function21
Non-code lines (comments, blank lines)16
Code lines (lines that can run)5
Code lines that did run3
Code lines that did not run2
Coverage (did run/can run)60.00 %
Function listing
time 
Calls 
 line
   1 
function c = countcats(a,dim)
   2 
%COUNTCATS Count occurrences of categories in a categorical array's elements.
   3 
%   C = COUNTCATS(A), for a categorical vector A, returns a vector C containing
   4 
%   the number of elements in A whose value is equal to each of A's categories.
   5 
%   C has one element for each category in A.
   6 
%
   7 
%   For matrices, COUNTCATS(A) is a matrix of counts.  Each column of C contains
   8 
%   counts for a column of A.  For N-D arrays, COUNTCATS(A) operates along the
   9 
%   first non-singleton dimension.
  10 
%  
  11 
%   C = COUNTCATS(A,DIM) operates along the dimension DIM.
  12 
%
  13 
%   See also ISCATEGORY, ISMEMBER, SUMMARY.
  14 

  15 
%   Copyright 2013 The MathWorks, Inc. 
  16 

< 0.001 
      6 
  17
if nargin < 2 
< 0.001 
      6 
  18
    c = histc(a.codes,1:length(a.categoryNames)); 
  19 
else
  20 
    c = histc(a.codes,1:length(a.categoryNames),dim);
< 0.001 
      6 
  21
end 

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