(Matlab version is 18.104.22.1687 (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,
and calling it like this form the OS command shell:
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?