0
votes

https://www.mathworks.com/help/matlab/matlab_external/gateway-routine.html

"mex" is the framework matlab uses to run c/c++ functions in matlab (runs faster). In the documentation it says "input parameters (found in the prhs array) are read-only; do not modify them in your MEX file. Changing data in an input parameter can produce undesired side effects."

Is this simply a warning about how changing a variable passed as a pointer will change that variable even outside of the function (unlike how matlab works), or is there a more subtle way that this can mess up the matlab/mex interface?

Reason I am asking is I specifically want the mex function to modify the arguments for real.