Matlab을 처음 사용하고 수퍼 클래스 메서드를 호출 할 때 몇 가지 문제가 있습니다.Matlab에서 수퍼 클래스 메서드를 호출 할 수 없습니다.
슈퍼 클래스의 TEST1 :
classdef test1 < handle
methods
function obj = test1()
end
function test2(obj)
disp(1);
end
end
end
서브 클래스 테스트 :
나는이 코드를 가지고
classdef test < test1 & handle
properties
foo = 1;
end
methods
function obj = test()
obj = [email protected]();
end
function a = bar(obj)
superclasses(obj)
[email protected](obj)
end
end
end
은 상속이 제대로 작동을; 슈퍼 클래스 함수는 test
의 수퍼 클래스로 test1
을 표시합니다. 내가 [email protected](obj)
를 호출 할 때, 그것은 오류를 반환 :
"@" Within a method, a superclass method of the same name is called by saying [email protected] The left operand of "@" must be the method name.
test
이 방법은 분명히 슈퍼 test1
내에 존재, 그래서 정확히 무슨 일이 잘못 모르겠어요.
네, 이제 작동합니다. 정말 고맙습니다! – user3245507