MATLAB: Calling a java class from matlab

java classMATLAB

I have a java class, and I need to call it from matlab to implement a document. is that you have an idea?

Best Answer

It depends on whether it has been packaged into a .jar file or is a .class file.
Your class is called hello.HelloWorld
If it's in a file called c:\work\hello\HelloWorld.class, you need to add the root directory to the class path.
javaaddpath c:\work\
function Test()
hello.HelloWorld();
end
On the other hand, if it's in a c:\work\hello.jar file, you add the jar file to the class path.
javaaddpath c:\work\hello.jar
After that's it's the same.