This is an error within the documentation for MATLAB 7.2 (R2006a) within the Calling Java from MATLAB section of the External Interfaces manual.
The documentation should read as follows:
"MATLAB automatically converts the cell array elements to java.lang.Object class objects. Note that in order for a cell array to be passed from MATLAB, the corresponding argument in the Java method signature must specify java.lang.Object or an array of java.lang.Object."
To pass an array to java, you can either manually create an array of objects of the correct type, or modify the Java method to accept arguments of type java.lang.Object.
1. For example to create a Java array of the appropriate type do the following:
jHarray = javaArray('java.util.Hashtable',4);
jHarray(1) = java.util.Hashtable;
jHarray(1).put('a',3);
jHarray(2) = java.util.Hashtable;
jHarray(2).put('a',12);
jHarray(3) = java.util.Hashtable;
jHarray(3).put('a',24);
jHarray(4) = java.util.Hashtable;
jHarray(4).put('a',36);
MatlabJavaBug.hello(jHarray);
2. Alternatively, you can convert the method to have the following signature. Before using the elements of the array, you will need to cast them to the appropriate class. For example the function header would be modified as follows:
public static void hello(java.lang.Object hash[])
Best Answer