You should use mxDuplicateArray
, thats the documented way:
#include "mex.h"
void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
{
plhs[0] = mxDuplicateArray(prhs[0]);
}
More Related Contents:
- Variable appears to change size on every loop iteration – what?
- Using GCC (MinGW) as MATLAB’s MEX compiler
- How to build mex file directly in Visual Studio?
- Consider preallocating for speed [duplicate]
- BSXFUN on memory efficiency with relational operations
- How to interpolate with MATLAB 3D usind scatteredinterpolant plot? [closed]
- Matlab how to save a modified image from axes [closed]
- how to get a single feature vector from SIFT descriptor [closed]
- Is it possible to define more than one function per file in MATLAB, and access them from outside that file?
- How to get all files under a specific directory in MATLAB?
- Loop through files in a folder in matlab
- Hash tables in MATLAB
- MATLAB’s Garbage Collector?
- Suppressing a function’s command window output
- Align already captured rgb and depth images
- How to normalize / denormalize a vector to range [-1;1]
- Sorting entire matrix according to one column in matlab
- How to generate a non-linear colormap/colorbar?
- How can I save an altered image in MATLAB?
- Generate and plot the empirical joint pdf and CDF [closed]
- Setting graph figure size
- String to variable name MATLAB
- Real time plot in MATLAB
- Matlab imshow omit NaN
- How to control the margin size around subplots?
- What is the equivalent to += in Matlab?
- Implementing anonymous functions in Fortran
- Customize dbstop in MATLAB
- How to apply a low-pass or high-pass filter to an array in Matlab?
- Remove xticks but keep xticklabels in MATLAB