Importing Java classes from the Matlab's -r argument it's not working
조회 수: 1 (최근 30일)
이전 댓글 표시
(Matlab version is 7.8.0.347 (R2009a) for windows and linux)
I'm experiencing problems with Java classes name resolution. I have been able to dig into problem and isolate the essence of it.
If I'm running this command from the OS command shell:
matlab -r "str=java.lang.String('Hello')"
it works perfectly. But running this very similar code
matlab -r "import java.lang.String;str=String('Hello')"
I'm getting this Matlab's error:
??? Undefined function or method 'String' for input arguments of type 'char'.
putting the code inside a function,
function dumfunc()
import java.lang.String;
str=String('Hello')
and calling it like this form the OS command shell:
matlab -r "dumfunc"
works perfectly. It doesn't work if a write the code lines into a script it must be a function.
It appears as problem with the name resolution of Java classes and more precissly with the import facility.
Any guess what is going on?
Regards
Antonio
댓글 수: 0
답변 (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!