JAVA-MATLAB connectivity
![[IMG]](proxy.php?image=http%3A%2F%2Fwww.crazyengineers.com%2Fcommunity%2FC%3A%5CJMatlink1.00%5Cinterface.gif&hash=d63a3b4c65e2af3063aa617f26a9fa94)
![[IMG]](proxy.php?image=http%3A%2F%2Fwww.crazyengineers.com%2Fcommunity%2FC%3A%5CJMatlink1.00%5Cinterface.bmp&hash=e8202861b61a8f21b287538ad2ac299d)
hello friends. i need help in the project using JAVA-MATLAB connectivity. here, the interface is created in JAVA and MATLABis used for mathematical processing. here, JAVA interface is created by extending the JFrame/ Frame class of javax.swing/java.awt. now, in textfield the name of the matlab file (say 'image.m' that includes the code for generating the scatterplot ) is to be entered and when the button is clicked the procesing starts in matlab that generates a scatterplot as figure (in MATLAB itself). now, there is a function in matlab im2java() in MATLAB that converts an image into instance of JAVA.
b=xlsread('sample.xls'); scatterplot(b); saveas(gcf,'b.jpg'); I = imread('b.jpg'); javaImage = im2java(I); frame = javax.swing.JFrame; icon = javax.swing.ImageIcon(javaImage); label = javax.swing.JLabel(icon); frame.getContentPane.add(label); frame.pack frame.showLet the above file be 'image.m'. here,sample.xls is an excel data read for generating scatterplot and b.jpg is an image of scatterplot generated is saved using saveas and is read from MATLAB directory. when frame.show is executed a new pop-up of JAVA instance opens up displaying the scatterplot.
But how can i display this directly in interface instead of pop-up? or is there any way to send the MATLAB generated scatterplot directly to java interface for displaying instead of saving and then reading the image back?
plz help.
![[IMG]](proxy.php?image=http%3A%2F%2Fwww.crazyengineers.com%2Fcommunity%2FC%3A%5CJMatlink1.00%5Cinterface.bmp&hash=e8202861b61a8f21b287538ad2ac299d)
0