%numArgumentsFromSubscript  Number of arguments for indexing methods
%   N = numArgumentsFromSubscript(A,S,indexingContext) returns the number of 
%   values that are returned from indexed reference statements of the form 
%   A{I}, A.f, or A(I).f, and the number of values required by indexed 
%   assignments of the form [A{I}] = B, [A.f] = B, or [A(I).f] = B.
%   
%   Arguments:
%   A - Array that is being indexed
%   S - Indexing structure, as returned by SUBSTRUCT
%   indexingContext - One of the following enumerated values of type
%                     matlab.indexing.IndexingContext:
%     Statement  - Indexed reference occurs by itself
%                  For example, obj.x
%     Expression - Indexed reference used as part of an expression
%                  For example, func(obj.x)
%     Assignment - Indexing on the left-hand side of assignment
%                  For example, [obj.x] = deal(y)
%   
%   Example:
%      For array A:
%         >> A = {1 2 3;4 5 6};
%      The indexing statement:
%         >> A{1,1:3}
%      Returns three values:
%         ans =
%              1
%         ans =
%              2
%         ans =
%              3
%      The indexing operation A{1,1:3} is represented by the following 
%      indexing structure:
%         >> S = substruct('{}',{1,1:3});
%      
%      The number of values returned by the indexing statement is:
%      
%         >> n = numArgumentsFromSubscript(A,S,...
%                   matlab.indexing.IndexingContext.Statement)
%         n =
%              3
%   
%   Overload numArgumentsFromSubscript in user-defined classes that
%   overload SUBSREF or SUBSASGN to customize indexing behavior. In such
%   classes, use this function to modify the number of arguments MATLAB
%   expects to be returned by overloaded SUBSREF methods, and expects to
%   pass to overloaded SUBSASGN methods.
%
%   Instead of implementing SUBSREF, SUBSASGN, and
%   numArgumentsFromSubscript, class authors can use the mixins in the
%   matlab.mixin.indexing package to overload indexing. See the
%   documentation for more information.
%   
%   See also SUBSTRUCT, SUBSREF, SUBSASGN, matlab.indexing.IndexingContext,
%            listLength, matlab.mixin.indexing.
%
%   Note: matlab.mixin.util.IndexingContext is the older name for
%   matlab.indexing.IndexingContext with exactly the same behavior,
%   members, and implementation, and continues to be supported by this
%   function.

%   Copyright 2015-2021 The MathWorks, Inc.
%   Built-in function.

