Принудительный класс для вызова базовой функции в MATLAB?

В базовом классе есть функция f. Производный класс перезаписывает функцию f. Я хочу вызвать базовый класс' f для объекта производного класса. Как это сделать?

Вот пример кода.

    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
                this@base.f(); % 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
5
задан Vahagn 16 September 2011 в 12:53
поделиться