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: arDeepCopy.m
    path of file: ./repos/d2d/arFramework3/Advanced
    
    the code of the file until where you have to start completion: % copy = arDeepCopy(in)
%
% Recursively deepcopy a structure to avoid MATLAB's shallow copying behaviour
%
% in   - arStruct
% copy - arStruct
%
% Sometimes you really wish to compare subfields of two ar structures; one of which
% you are currently still simulating with. What can happen is that MATLAB makes a shallow 
% copy of some subfiel
    
function to make a deep copy of the ar struct into another variable.
%
%   Deeply copies: substructures, cell arrays, matrices, numbers, strings and logicals
%   Does not deepcopy: matlab handles (such as figures)
%   This function is *very* slow, but will do the job
%
% Example
%   arModel = arDeepCopy(ar)

function copy = arDeepCopy(in)

	if ( isstruct( in ) )
        if ( length( in ) > 1 )
            for s = 1 : length( in )
                copy(s) = arDeepCopy(in(s));%#ok<AGROW>
            end