将回调函数句柄存储为私有属性似乎解决了这个问题.试试这个:
classdef MyClass properties handle; end properties (Access=private) callback; end methods function this = MyClass(args) this.callback = @myCallbackMethod; this.handle = uicontrol('Callback', ... {@(src, event)myCallbackMethod(this, src, event)}); end end methods (Access = private) function myCallbackMethod(this, src, event) disp('Hello world!'); end end end