% c1.m: classdef c1 methods (Static) function m1 (obj) disp ('c1:m1'); end end end % c2.m: classdef c2 methods function m1 (obj) disp ('c2:m1'); end function sin (obj) disp ('c2:sin'); end function fh = m1_h (obj) fh = @m1; %% Does this always bind to c2:m1 %% or can lookup rules result in a %% call to another function if arg %% is not c2 object? end function fh = sin_h (obj) fh = @sin; end end end % m1.m: function m1 (x) disp ('m1'); disp (x); end % code: c1_obj = c1 (); c2_obj = c2 (); m1_fh = c2_obj.m1_h (); sin_fh = c2_obj.sin_h (); m1_fh (pi) %% m1 or error from c2:m1 about wrong type? m1_fh (c2_obj) %% c2:m1, I assume m1_fh (c1_obj) %% c1:m1, or error from c2:m1 about wrong type? sin_fh (pi) %% built-in sin or error from c2:sin about wrong type? sin_fh (c2_obj) %% c2:sin, I assume fh = @sin; fh (pi) %% built-in sin, I assume. fh (c2_obj) %% c2:sin or error from built-in sin about wrong type?