classdef A
  properties
    foo
  end
  methods
    function f = A(val)
      f.foo = val;
    end
    function h = plus(f, g)
      disp('called A::plus')
      h = 2*f.foo + g.foo;
    end
  end
end
