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: length.m
    path of file: ./repos/d2d/arFramework3/ThirdParty/StrucID/adimat/opt_derivclass/@adderiv
    
    the code of the file until where you have to start completion: %ADDERIV/LENGTH Get the length of object that the derivative is associated with.
%
%       This function returns max(size(g))
%
% see also adderiv/size
%
% Copyright 2009 Johannes Willkomm, Institute for Scientific Computing   
% Copyright 2001-2008 Andre Vehreschild, Institute for Scientific Computing   
%                 
    
function returns max(size(g))
%
% see also adderiv/size
%
% Copyright 2009 Johannes Willkomm, Institute for Scientific Computing   
% Copyright 2001-2008 Andre Vehreschild, Institute for Scientific Computing   
%                     RWTH Aachen University
% This code is under development! Use at your own risk! Duplication,
% modification and distribution FORBIDDEN!
%
function res = length(g)
  res = max(size(g));
end