Matlab: avoiding memory allocation in mex
问题 I'm trying to make my mex library avoid all memory allocation what so even. Until now, the mex got an input, created some matrices using mxCreate...() and returned this output. But now I'd like to modify this interface so that the mex itself would not do any allocations. What I had in mind is that the mexFunction will get as input the matrix to fill values into and return this very same matrix as an output. Is this supposed to be possible? The slight alarm that got me thinking if this is at