In MATLAB there is nothing like a pointer, there are local workspaces .
MATLAB seems to be smart, and makes a copy and returns when necessary, and passes a "pointer" (without your knowledge) if it is not required. As noted @Daniel and @zeeMonkeez, discussed in Loren blog here , and it clearly responds to the reset function, when the memory was created inside here . The general idea in these posts is that βMATLAB will not copy unless neededβ
Basically, MATLAB abstracts you from memory management.
Sidenote: There is something like pointers if you really need to use this. See Comment by @excaza.
source share