abstract class using implemented methods
Mostra commenti meno recenti
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?
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su Web Services in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!