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: adimat_push_index.m
    path of file: ./repos/d2d/arFramework3/ThirdParty/StrucID/adimat/runtime
    
    the code of the file until where you have to start completion: % function r = adimat_push_index(arrayVar, index1, ...)
%   Store values given by arrayVar(index1, ...) on the stack, if this
%   indexing is possible. Otherwise the whole variables has to be
%   saved, in order to restore it to previous size later.
%
% see also adimat_push, adimat_push_cell_index, adimat_pop_index

    
function r = adimat_push_index(arrayVar, index1, ...)
%   Store values given by arrayVar(index1, ...) on the stack, if this
%   indexing is possible. Otherwise the whole variables has to be
%   saved, in order to restore it to previous size later.
%
% see also adimat_push, adimat_push_cell_index, adimat_pop_index
%
% This file is part of the ADiMat runtime environment
%
function adimat_push_index(indexVar, varargin)
  try
    adimat_push(indexVar(varargin{:}));
    adimat_push(0);
  catch
    adimat_push(indexVar);
    adimat_push(1);
  end