我试图通过这样做来使用Matlab的org.apache:
javaaddpath('~/.m2/repository/org/apache/commons/commons-math3/3.2/commons-math3-3.2.jar');
import org.apache.commons.math3.stat.correlation.*
c = org.apache.commons.math3.stat.correlation.KendallsCorrelation();
我收到以下错误:
Undefined variable "org" or class "org.apache.commons.math3.stat.correlation.KendallsCorrelation"
我该如何解决?
答案 0 :(得分:0)
KendallsCorrelation类仅存在于数学版本3.3中,我试图使用版本3.2。以下代码有效:
javaaddpath('~/matlab/jars/commons-math3-3.3/commons-math3-3.3.jar');
import org.apache.commons.math3.stat.correlation.*
c = org.apache.commons.math3.stat.correlation.KendallsCorrelation();
c.correlation([4 2 0], [3 2 1])