You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: Reader.m
    path of file: ./repos/u-shape3D/software/@Reader
    
    the code of the file until where you have to start completion: classdef  Reader < handle & matlab.mixin.Copyable
    % Reader is an abstract class for reading image data in a plane-wise
    % fashion
    %
    % Arguments are generally in the order C, T, Z
    %
    % Properties
    % ----------
    % (use the get methods rather than these properties)
    % sizeX, sizeY, sizeZ, sizeC, sizeT, bitDepth
    %
    % Reader methods:
    %
    % Public Methods
    % --------------
    % loadImage(c, t, [z], ...) - loads an image plane at channel c, time
    % point t, and optionally at z-p
    
function I = loadStack(obj, c, t, varargin)
        % loadStack reads a Z-stack and returns a YXZ Matrix
        %
        %   loadStack(c,t,Z) returns a Z-stack for channel c and
        %   time frame t  with Z planes indicated by the vector Z
        %
        %   loadStack(c,t) returns loadStack(c,t, 1: getSizeZ())
        %
        % output: a 3D matrix with dimensions YXZ
        %
        % Note: Override only if need you need to overload or change how
        % the input is checked. Otherwise override loadStack_.
        %
        % Example:
        %   reader = movieData.getReader();
        %   % The following are all equivalent
        %   zStackMatrix = reader.loadStack(1,1,1:reader.getSizeZ());
        %   zStackMatrix = reader.loadStack(1,1);
        %   zStackMatrix = reader.loadStack(1);
        %
        
            % Input check
            ip = inputParser;
            if(any(cellfun(@(s) strcmp(s,'ZSize'),(varargin(cellfun(@ischar,varargin))))))
                ip.addRequired('c', @isnumeric);
                ip.addRequired('t', @isnumeric);
                ip.addOptional('z',[], @isnumeric);
                ip.addParamValue('ZSize',[], @isnumeric);
                ip.parse(c, t, varargin{:});
                ZSize=ip.Results.ZSize;
            else
                ZSize=obj.getSizeZ();
                ip.addRequired('c', ...
                    @(x) insequence_and_scalar(x, 1, obj.getSizeC() ) );
                ip.addRequired('t', ...
                    @(x) insequence_and_scalar(x, 1, obj.getSizeT() ) );
                ip.addOptional('z', [] , ...
                    @(x) all_insequence(x,1,      ZSize )  );
                ip.parse(c, t, varargin{:});
            end