Clone an object
Use this function to deep copy (clone) an object
new = clone( obj );
Copyright Imperial College London 2019