Robuta

https://au.mathworks.com/help/matlab/apiref/mxduplicatearray.html mxDuplicateArray (C and Fortran) - Make deep copy of array - MATLAB Pointer to the mxArray you want to copy copy offortranmakedeeparray