This question popped into my twitter stream, so I'm not so personally interested in the answer yet, but when I do need the answer, I'd expect to find it here.
The question: How do I pass a Java object as a parameter to a MATLAB function?
Specifically, I wrote a Matlab class to implement a database using JDBC and stuff from java.sql.
copying the rest of the question from Jim's Answer:
I needed to know how many results were in a ResultSet, so I wrote the following Matlab static function:
methods (Static)
function [numRecords] = numRecords(resultSet)
numRecords = 0;
if (~isempty(resultSet))
row = resultSet.getRow();
resultSet.beforeFirst();
resultSet.last();
numRecords = resultSet.getRow();
resultSet.absolute(row);
end
end
end
But when I try to call it, I get the following error message:
??? Undefined function or method 'numRecords' for input arguments of type 'org.apache.derby.impl.jdbc.EmbedResultSet40'
There are no other functions called numRecords.