matlab builder ja

6
MATLAB Builder JA 2.2.2 for Java language Deploy MATLAB code as Java classes 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. MATLAB Builder JA Overview MATLAB Builder JA Overview 5:26 Create MATLAB based Java components for use by non-MATLAB users and integrate them into the main Java Web application. Key Features Royalty-free desktop and Web deployment of Java classes MATLAB figure zooming, rotating, and panning via the Web Figures interface Ability to port classes not containing MEX-files to all MATLAB supported platforms API for automatic conversion between Java and MATLAB data types 1

Upload: pedro-filipe

Post on 02-Dec-2014

428 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Matlab Builder Ja

MATLAB Builder JA 2.2.2for Java languageDeploy MATLAB code as Java classes

MATLAB Builder™ JA enables you to create Java™ classes from your MATLAB® programs. These Java classes canbe integrated into Java programs and deployed royalty-free to desktop computers or Web servers that do not haveMATLAB installed.

When used with MATLAB Compiler™, the builder creates deployable components that make MATLAB basedcomputations, visualizations, and graphical user interfaces accessible to end users of the Java programs. When theJava 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 justlike any other Java class. Java classes created with MATLAB Builder JA are portable and run on all platformssupported by MATLAB.

MATLAB Builder JA OverviewMATLAB Builder JA Overview 5:26

Create MATLAB based Java components for use by non-MATLAB usersand integrate them into the main Java Web application.

Key Features▪ Royalty-free desktop and Web deployment of Java classes

▪ MATLAB figure zooming, rotating, and panning via the Web Figures interface

▪ Ability to port classes not containing MEX-files to all MATLAB supported platforms

▪ API for automatic conversion between Java and MATLAB data types

1

Page 2: Matlab Builder Ja

Java Web application for visualizing a surface plot of the MATLAB peaks function. The builder’s Web Figuresinterface provides the zoom, pan, and rotate icons, letting the end user manipulate the image.

Working with MATLAB Builder JA

Together, MATLAB, MATLAB Compiler, and MATLAB Builder JA enable you to develop applications usingMATLAB, and then incorporate them in Java programs. You use MATLAB—a high-level, matrix-optimizedlanguage with built-in math, graphics, and data analysis functions—to rapidly prototype, implement, and test youralgorithms. Once an application is complete, you use the builder to automatically package MATLAB code as Javaclasses. These classes can be integrated in a Java application and referenced in the same way as standard Javaclasses.

Like other Java components, the JAR files generated by the builder are generally platform-independent and run onany platform supported by MATLAB. Some toolbox functions are implemented as MEX-files, which areplatform-dependent, making these functions and any Java components that use them not portable.

Using MATLAB Builder JAUsing MATLAB Builder JA 6:48

Create a deployment tool project, add a MATLAB script, compile it into aJava component, integrate the component into a Java application, testand prepare it for distribution to non-MATLAB users.

To create portable Java classes from MATLAB functions, the builder encrypts the functions and generates a Javawrapper around them. To deploy these classes, you first install the MATLAB Compiler Runtime (MCR) on atarget computer, and then run the classes incorporated in a Java program against the MCR. The MCR (provided

2

Page 3: Matlab Builder Ja

with MATLAB Compiler) is the full set of shared libraries required for executing MATLAB based components. Itprovides complete support for all features of the MATLAB language and most toolboxes.

Using MATLAB Builder JA to convert the MATLAB file plotfft.m into a Java component called SpectralAnalysis, witha class called Fourier.

Building and Packaging Components with the Deployment Tool

The Deployment Tool is a graphical user interface provided by MATLAB Compiler. You use it to build Javaclasses from MATLAB applications and then package them for deployment.

From the Deployment Tool you can:

▪ Add MATLAB files and MEX-files to serve as externally visible class methods of your component

▪ Automatically collect and package the files to deploy with the component

▪ Add supporting files, including the MCR, to be packaged with your component in a self-extracting executable

▪ Save compilation and packaging preferences

3

Page 4: Matlab Builder Ja

Financial application for calculating and visualizing Black-Scholes option value. The application uses MATLABfunctions converted into a Java class by the builder to perform calculations and produce graphs.

Accessing Components

After instantiating a Java class from a MATLAB based component, you can access MATLAB functions as nativeJava methods. Native Java data types passed to MATLAB functions are automatically converted to MATLAB datatypes. Alternatively, you can explicitly select the data type to use.

A Java Swing GUI that calls MATLAB code for a loan amortization calculation using Java Native Interface (JNI).

Deploying MATLAB Based Java Components on a Desktop Computer

You integrate a MATLAB based Java class into an existing Java application by installing both the class and theMCR (royalty-free) on the target computer. The MCR provides complete support for all features of the MATLABlanguage and most toolboxes. The Java application serves users working on the target computer. Using thebuilder’s Remote Method Invocation (RMI) interface, you can also run your class as a persistent service or spreadprocessing across multiple processes or computers.

4

Page 5: Matlab Builder Ja

Mean-variance portfolio optimization and generation of an efficient frontier. Computed risk/return pairs and theassociated stock weights are listed for each risk/return value. The graphical interface is written using the Java Swinglibraries, and the underlying mathematics is performed by a Java component created by MATLAB Builder JA.

Deploying MATLAB Based Java Components on a Local Network or the Web

Deploying Java components on a local network or Web server enables multiple users to access an application inwhich the Java component is integrated. You install the MCR on the server only, and users can execute theapplication without installing MATLAB or the MCR on their individual computers. Users can interactdynamically with MATLAB figures through the builder’s Web Figures interface for handling the 2D and 3D datavisualization such as zooming, rotating, and panning.

MATLAB Builder JA WebFiguresMATLAB Builder JA WebFigures 5:22

Create interactive WebFigures from MATLAB figures and integrate theminto a JSP page.

You can also access MATLAB Web applications deployed as Java components with service-oriented architectures(SOAs), SOAP services, WDSL language, RMI interfaces, HTTP services, Java servlets, and JSPs.

5

Page 6: Matlab Builder Ja

Product Details, Demos, and System Requirementswww.mathworks.com/products/javabuilder

Trial Softwarewww.mathworks.com/trialrequest

Saleswww.mathworks.com/contactsales

Technical Supportwww.mathworks.com/support

Financial application for calculating and visualizing Black-Scholes option value implemented as a MATLAB Webapplication. The application uses MATLAB functions converted into a Java class by MATLAB Builder JA to performcalculations and produce graphs.

Resources

Online User Communitywww.mathworks.com/matlabcentral

Training Serviceswww.mathworks.com/training

Third-Party Products and Serviceswww.mathworks.com/connections

Worldwide Contactswww.mathworks.com/contact

© 2011 The MathWorks, Inc. MATLAB and Simulink are registered trademarks of The MathWorks, Inc. See www.mathworks.com/trademarksfor a list of additional trademarks. Other product or brand names may be trademarks or registered trademarks of their respective holders. 6