Lots of people bump into unexpected shallow copy behavior when they start off in Python, and I'd like to make sure I don't make any of those mistakes in MATLAB (with which I have less experience).
I read this article about object behaviors in MATLAB and I read this question that pertains to pointer/handle behavior. Are there any situations where isa(obj, 'handle')
would return false but you would still encounter the situation where modification of obj
would result in the modification of another variable (to my knowledge, any argument modification by a function call should trigger a copy on write and duplicate the variable in memory)?
Is this a complete understanding of "shallow copy"-like behavior in MATLAB? Are there any additional caveats to standard value object copy behavior?