I'm making a GUI with Matlab's guide. I'm placing points with impoint, and I use addNewPositionCallback to be able to update my 'point list'. One of the arguments given to my update function that I give as a callback, is the 'handles' object. But Matlab passes this by value, so when the callback is called, I do have the handles object there but it's an outdated version. I would like to have something like a pointer to the handles object.
Or more general: I would like to access the 'handles' object somewhere in a function where I don't have it as a parameter.
Edit: So I have a callback function that look like this:
function updatePosition(pos, hObject, handles)
Which I add as a callback like this:
addNewPositionCallback(testh,@(pos) updatePosition(pos, hObject, handles));
And I have a pointlist in the handles, handles.pointlist
. It should contain 5 points, but when I have an updatePosition call for the first point, the list contains just one point: the handles does not seem to be updated, it just has a copy from earlier on.