Matlab 7.5(2007b)在重载的子类中调用超类函数

时间:2016-02-26 14:06:20

标签: matlab overloading

当我打电话

p = inputParser2;
addRequired(p, 'A');

在Matlab 7.5(2007b)中,

classdef inputParser2 < inputParser
  methods
    function addRequired(obj, argname, varargin)
      addRequired@inputParser(obj, argname);
    end
  end
end

我收到错误消息

??? Error using ==> mcos_parent_function_
addRequired is not a method of base class inputParser.

Error in ==> inputParser2>inputParser2.addRequired at 5
      addRequired@inputParser(obj, argname);

addRequired显然是类inputParser的方法?

0 个答案:

没有答案