www.gusucode.com > bigdata 工具箱 matlab源码程序 > bigdata/@tall/subsref.m

    function varargout = subsref(obj, S)
%SUBSREF Subscripted reference for tall
%   B = SUBSREF(A, S) is the functional form of subscripted reference.
%
%   Only the following forms of indexing are supported:
%   B = A(L, SUBS...)
%   where: A is a tall
%          L is a logical tall selecting slices of A
%          SUBS... is zero or more non-tall trailing subscripts
%   B = A(:, SUBS...)
%   where: A is a tall
%          The subscript in the tall dimension is ':'
%          SUBS... is zero or more non-tall trailing subscripts
%
%   B = A(P:Q, SUBS...)
%   where: P:Q is either in the form: 1:N or END-N:END
%          SUBS... is zero or more non-tall trailing subscripts
%
%   See also subsref, tall.

%   Copyright 2015-2016 The MathWorks, Inc.

try
    numOut = max(1, nargout);

    S = checkTallSubs(S, mfilename, 'MATLAB:bigdata:array:SubsrefInvalidTallSubscript');

    switch S(1).type
      case '()'
        method = @subsrefParens;
      case '{}'
        method = @subsrefBraces;
      case '.'
        method = @subsrefDot;
    end
    % Some methods need the full size of the array, so extract that.
    sz = size(obj);
    [varargout{1:numOut}] = method(obj.Adaptor, obj.ValueImpl, sz.ValueImpl, S);
catch E
    throwAsCaller(E);
end
end