Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/363.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/matlab/15.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/cocoa/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 在Matlab中使用org.apache_Java_Matlab_Apache Commons - Fatal编程技术网

Java 在Matlab中使用org.apache

Java 在Matlab中使用org.apache,java,matlab,apache-commons,Java,Matlab,Apache Commons,我试图通过以下方式使用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(); 我得到以下

我试图通过以下方式使用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"

如何修复它?

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])

问题是Matlab使用的是Java6,而我的机器上安装了Java7吗?如果是这样的话,我该如何解决这个问题呢?事实证明,Kendall的相关性并没有出现在数学版本3.2中,而是出现在3.3中。我已经下载并导入了这个版本,现在它似乎可以工作了。