abstract class using implemented methods
이전 댓글 표시
Hello,
I have a superclass:
classdef Dic
methods (Access = protected, Static = true, Abstract)
value = fun1(F,~)
value = fun2(~,G)
end
methods (Static = true)
function r = Calculation(F,G)
r = fun1(F) + fun2(G);
end
end
end
Which has the implemented Function Calculation and 2 abstract functions fun1 and fun2.
classdef Zsd < Dic
methods (Access = protected, Static = true, Abstract = false)
function value = fun1(F,~)
value = F - mean2(F);
end
function value = fun2(~,G)
value = G - mean2(G);
end
end
end
In the second class I implement fun1 and fun2, now if I call:
Zsd.Calculation(magic(4), magic(4))
I get the following error:
Undefined function or variable 'fun1'.
Can someone help me?
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Web Services에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!