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: getdimsiz.m
    path of file: ./repos/fieldtrip/contrib/nutmegtrip/private
    
    the code of the file until where you have to start completion: function dimsiz = getdimsiz(data, field, numdim)

% GETDIMSIZ
%
% Use as
%   dimsiz = getdimsiz(data, field)
% or
%   dimsiz = getdimsiz(data, field, numdim)
%
% MATL
    
function

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% SUBFUNCTION to determine the size of data representations like {pos}_ori_time
% FIXME this will fail for {xxx_yyy}_zzz
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function siz = cellmatsize(x)
if iscell(x)
  if isempty(x)
    siz = 0;
    return % nothing else to do
  elseif isvector(x)
    cellsize = numel(x);          % the number of elements in the cell-array
  else
    cellsize = size(x);
    x = x(:); % convert to vector for further size detection
  end