I have a little problem in Matlab regarding property listeners. I added a listener to the properties XLimand YLimaxis running on PostSet:
h = addlistener(myaxes,{'XLim','YLim'},'PostSet',@myfunc);
Now I want my program to do something after changing the properties, or only one of them has changed, but in the latter case I must be sure that the other has not been changed.
When using the axis scaling tool, the properties always change both and always in order x, then y. Therefore, in this case I would not have a problem, but sometimes I set the properties XLimeither YLimprogrammatically and want the same function to start. Somehow, I should be able to say whether only one of these two properties caused the listener, or both.
At the current stage, my callback is executed twice: once for XLimand once for YLim. I want it to be executed exactly once, and it is after I know that there are no changes in the two properties. You do not know how to do this?
source
share