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: size.m
    path of file: ./repos/EEGapp/EEGapp/custom_stuff/Brain_net/BrainNet_spm8_files/@file_array
    
    the code of the file until where you have to start completion: function d = size(a,varargin)
% overloaded size function for file_array objects.
% _______________________________________________________________________
% Copyright (C) 2008 Wellcome Trust Centre for Neuroimaging

%
% $Id: size.m 3730 2010-02-17 13:24:26Z john $


sa  = struct(a);
nd  = 0;

    
function d = size(a,varargin)
% overloaded size function for file_array objects.
% _______________________________________________________________________
% Copyright (C) 2008 Wellcome Trust Centre for Neuroimaging

%
% $Id: size.m 3730 2010-02-17 13:24:26Z john $


sa  = struct(a);
nd  = 0;
for i=1:numel(sa),
    nd = max(nd,numel(sa(i).dim));
    nd = max(nd,max(find(sa(i).pos==1)));
end