7 ms·
I'm well aware of how and when it works. It is the recognized idiom to perform in-place operations in practice in Matlab code [1]. It would be nice to take adv
by imurray 11y ago
I'm well aware of how and when it works. It is the recognized idiom to perform in-place operations in practice in Matlab code [1].
It would be nice to take advantage of the same idea in mex code where possible. For example an API function that indicates if it is safe to over-write an input array and return it as the corresponding output or not. I don't think Mathworks currently provide documented and future-safe means to do so however. (If one controls all the code, updating things in-place is possible in practice if careful, using the A(1)=A(1); trick I gave in a parent post. Such code is just not guaranteed to be future-proof.)
[1] http://blogs.mathworks.com/loren/2007/03/22/in-place-operations-on-data/ http://blogs.mathworks.com/loren/2007/03/22/in-place-operati...