Base class has a function f. Derived class overwrites the function f. I want to call base class' f for an object of the derived class. How can I do this?
Here is the code sample.
classdef base
methods ( Access = public )
function this = f( this )
disp( 'at base::f' );
end
end
end
classdef derived < base
methods ( Access = public )
function this = f( this )
% HERE I WANT TO CALL base::f
[email protected](); % this is an error
disp( 'at derived::f' );
end
end
end
d = derived();
d.f();
% here the result should be
% at base::f
% at derived::f
at derived::f
, since that statement gets executed after the call to f@base. I don't understand the infinite loop, though. – Afforest