Calling Java from Matlab
显示 更早的评论
I've seen there are a number of descriptions about this on the web, but I seem to be running into trouble. I have a simple Java function that I have compiled successfully in Java
// Java Code
//*------------------------------------
package testfunction;
public class TestFunction
{
public static void main(String[] args) {
System.out.println("Hello, World");
}
}
//*------------------------------------
and I am attempting to load and call from Matlab
%%Matlab Code
% ---------------------------------------
javaclasspath({
'C:\Users\username\Desktop\JavaFunctions\TestFunction', ...
'C:\Users\username\Desktop\JavaFunctions\TestFunction\dist\TestFunction.jar'...
});
import testfunction.*
import testfunction.TestFunction
% ----------------------------------------
I can't even get test function to import correctly, I'm sure I'm missing something I just don't know what. Any assistance is welcome
采纳的回答
更多回答(1 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Deploy to Java Applications Using MWArray Data API 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!