"Rebecca" wrote in message <email@example.com>...
> I have written an application in Matlab and compiled it into Java code using the JA builder. I'm really stuck from here as to how to integrate it into my application. How do I handle data type conversion, call the functions, etc.
> The algorithm that I wrote in Matlab is for image processing, how can I pass a java buffered image to that function?
There are all sorts of direct interfaces possible but the easiest and safest approach is to simply write the BufferedImage to file in some standard format, then read this file in Matlab.
For a more direct approach read http://www.mathworks.com/support/solutions/en/data/1-2WPAYR/index.html
An equivalent but much faster variant of the above, courtesy of Jan Simon:
pixelsData = reshape(typecast(jImage.getData.getDataStorage, 'uint8'), 4, w, h);
imgData = cat(3, ...
transpose(reshape(pixelsData(3, :, :), w, h)), ...
transpose(reshape(pixelsData(2, :, :), w, h)), ...
transpose(reshape(pixelsData(1, :, :), w, h)));