%COUNT Returns the number of occurrences of a pattern in text.
%   C = COUNT(STR,PAT) returns the number of occurrences of PAT in
%   STR.
%
%   STR must be text, which means it can be a string array, a character
%   vector, or a cell array of character vectors. PAT can be text or a
%   pattern array. PAT and STR need not have the same size. COUNT returns
%   the number of occurrences of all elements of PAT in STR. If STR is a 
%   string array or cell array, then C is a double array that is the same
%   size.
% 
%   C = COUNT(STR,PAT,'IgnoreCase',IGNORE) ignores case when searching 
%   for PAT in STR if IGNORE is true. The default value of IGNORE is false.
% 
%   Examples:
%       STR = "data.tar.gz";
%       PAT = "tar";
%       COUNT(STR,PAT)
%
%        % returns  1
%
%       STR = ["abstracts.docx","data.tar.gz"];
%       PAT = 'tar';
%       COUNT(STR,PAT)
%
%       % returns  [0 1]
%
%       STR = "music.mp3";
%       PAT = lettersPattern(1);
%       COUNT(STR,PAT)
%
%       % returns  7
%
%       STR = "data.tar.gz";
%       PAT = {'docx','tar'};
%       COUNT(STR,PAT)
%
%       % returns  1
%
%       STR = {'DATA.TAR.GZ','SUMMARY.PPT'};
%       PAT = "tar";
%       COUNT(STR,PAT,'IgnoreCase',true)
%
%       % returns  [1 0]
%
%   See also endsWith, startsWith, contains, pattern, lettersPattern.

%   Copyright 2015-2020 The MathWorks, Inc.
