How to use java class that I made in matlab?
조회 수: 2 (최근 30일)
이전 댓글 표시
How to use java class that I made in matlab?
I made a package. So, I want to use it in the MATLAB. But I can't do it.
ex) import java.lang.String, which is possible.
But the class that I made is unaccessible. How can I import mine?
or Where should I save my package?
please help me...
댓글 수: 1
Adam
2015년 11월 16일
As far as I am aware it should simply be on your path and compiled into .class (I think) files.
채택된 답변
Kirby Fears
2015년 11월 16일
편집: Kirby Fears
2015년 11월 16일
Matlab has a java session that will only see your package if it's on that session's class path. You'll be able to import your package after adding it to the class path using javaaddpath() in Matlab. For example:
filepath = 'C:/mypackage.jar'
javaaddpath(filepath);
import mypackage.Class1; % imports Class 1 within mypackage
Hope this helps.
댓글 수: 2
Kirby Fears
2015년 11월 17일
Your classname is "Vector2", not "Vetor2". Does import work when you correct the spelling?
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 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!