Community of Java Developers: Get Java Programming Help from fellow Java Developers across the world.
Join this group to post and comment.
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?
Check this out: https://www.mathworks.in/products/javabuilder/
Hope it helps...
Hope it helps...
MATLAB Builder™ JA enables you to create Java™ classes from your MATLAB® programs. These Java classes can be integrated into Java programs and deployed royalty-free to desktop computers or Web servers that do not have MATLAB installed.
When used with MATLAB Compiler™, the builder creates deployable components that make MATLAB based computations, visualizations, and graphical user interfaces accessible to end users of the Java programs. When the Java program is deployed to the Web, multiple users can access it through a Web browser.
The builder encrypts your MATLAB functions and generates a Java wrapper around them so that they behave just like any other Java class. Java classes created with MATLAB Builder JA are portable and run on all platforms supported by MATLAB.
hey. thanks for replying... but i dont know anything about it. i searched even. but it's not available for free download and usage. it would be a great help if you provide any links for free download of MATLAB builder JA , if possible. Thank you once again.