I have some matlab code and some java code that need to talk. I was getting a NoSuchMethodError When I pass a matlab double array to a java method that accepts double[] argument.
So i write a simple "hello world" to get the class of an object passed to the method
public void printArray(Object array) {
System.out.println(array.getClass());
System.out.println(array.getClass().getPackage());
}
Calling this method from matlab, i get this interesting output
>> a.printArray(2)
class java.lang.Double
package java.lang
>> a.printArray('hello')
class java.lang.String
package java.lang
>> a.printArray(true)
class java.lang.Boolean
package java.lang
>> a.printArray([2 3 4])
class [D
null
>> a.printArray([true false])
class [Z
null
Can someone explain whats happening. I have matlab r14 and the java class is compiled with 1.3 compatibility