how to passs output of Java program to m-file
이전 댓글 표시
Hello folks,
I have written a Java program which is invoked using system() function, thus it runs on the command window of Matlab. Now I want to know if there's another way to run a Java program other than running it on command window? Can it be run on any user made GUI in Matlab? Another problem is, I want to know if my program has some string value as output, which is generally displayed on command window, how can i store it in variable in Matlab?
Hope to hear from you very soon.
답변 (1개)
Kaustubha Govind
2011년 5월 18일
0 개 추천
댓글 수: 5
Neha
2011년 5월 18일
Kaustubha Govind
2011년 5월 18일
Richard has an example usage on http://www.mathworks.com/matlabcentral/answers/6923-calling-a-java-class-from-matlab
Once you have added your Java class directory to the classpath, simple instantiate that class in MATLAB.
Neha
2011년 5월 21일
Kaustubha Govind
2011년 5월 21일
What is the error that you see?
Jose Cruz
2021년 3월 2일
Hello, im currently having the same issue as the above fellow. I use the command javaaddpath, with the path to the .class file which i want to call a method from, and it gives me the following error
>> javaaddpath('C:\testeTobii\bin\tobii\Tobii.class');
>> o = Tobii;
Unrecognized function or variable 'Tobii'.
I have already tried to insert the path on "classpath.txt" file and creating a java file "javaclasspath.txt" placing it inside the prefdir of Matlab.
카테고리
도움말 센터 및 File Exchange에서 Call Java from MATLAB에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!