我々は1つの抽象クラスを持ってみましょう:実装クラスの機能に(プロパティなし)MATLABで抽象クラスを使用して
classdef ACalculation < handle
methods (Abstract)
[result] = calculate (this, data);
plot (this, data, limX, limY);
end
end
そしてACalculation
classdef Maximum < ACalculation
methods
function [result] = calculate (this, data)
%...
end
function plot (this, data, limX, limY)
%...
end
end
を実装し、いくつかの他のクラス私はすべての必要な情報を与えますだから私はどんなプロパティも必要ありません。 静的なクラスが必要なようです。しかし、静的なクラスがある場合、私はこの関数を呼び出す際に問題があります。 私はそのような何かをしたいと思います:
criteria = Maximum();
%......
result = criteria.calculate(data);
は、それが継承を使用するには悪い方法ですか? 機能を静的に変更するためのmatlabアドバイスを無視すべきですか? ここで他に何ができますか?
それは、ありがとう! – Lex