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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With