Why Does handle.listener Return an Error?

The new graphics system is based on MATLAB® objects, which do not support the use of handle.listener to create event listeners. To create listeners for graphics objects, use addlistener .

Note

Release 2010b and later support addlistener, so your code can run in multiple releases after you update it.