0% found this document useful (0 votes)
85 views6 pages

MATLAB Builder JA 2.1: Deploy MATLAB Code As Java Classes

MATLAB Builder JA enables you to create Java(tm) classes from your MATLAB(r) 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(tm), the builder creates deployable components that make MATLAB based computations, visualizations, and graphical user interfaces accessible to end users of the Java programs.

Uploaded by

Boumrah Ali
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
85 views6 pages

MATLAB Builder JA 2.1: Deploy MATLAB Code As Java Classes

MATLAB Builder JA enables you to create Java(tm) classes from your MATLAB(r) 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(tm), the builder creates deployable components that make MATLAB based computations, visualizations, and graphical user interfaces accessible to end users of the Java programs.

Uploaded by

Boumrah Ali
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

MATLAB Builder JA 2.

1
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.

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
Java Web application for visualizing a surface plot of the MATLAB peaks function. The builder’s Web Figures
interface provides the zoom, pan, and rotate icons, letting the end user manipulate the image.

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.

Working with MATLAB Builder JA

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

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

To create portable Java classes from MATLAB functions, the builder encrypts the functions and generates a Java
wrapper around them. To deploy these classes, you first install the MATLAB Compiler Runtime (MCR) on a
target computer, and then run the classes incorporated in a Java program against the MCR. The MCR (provided
with MATLAB Compiler) is the full set of shared libraries required for executing MATLAB based components. It
provides 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, with
a 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 Java
classes 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
Financial application for calculating and visualizing Black-Scholes option value. The application uses MATLAB
functions 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 native
Java methods. Native Java data types passed to MATLAB functions are automatically converted to MATLAB data
types. 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 the
MCR (royalty-free) on the target computer. The MCR provides complete support for all features of the MATLAB
language and most toolboxes. The Java application serves users working on the target computer. Using the

4
builder’s Remote Method Invocation (RMI) interface, you can also run your class as a persistent service or spread
processing across multiple processes or computers.

Mean-variance portfolio optimization and generation of an efficient frontier. Computed risk/return pairs and the
associated stock weights are listed for each risk/return value. The graphical interface is written using the Java Swing
libraries, 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 in
which the Java component is integrated. You install the MCR on the server only, and users can execute the
application without installing MATLAB or the MCR on their individual computers. Users can interact
dynamically with MATLAB figures through the builder’s Web Figures interface for handling the 2D and 3D data
visualization such as zooming, rotating, and panning.

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
Financial application for calculating and visualizing Black-Scholes option value implemented as a MATLAB Web
application. The application uses MATLAB functions converted into a Java class by MATLAB Builder JA to perform
calculations and produce graphs.

Resources
Product Details, Demos, and System Requirements Online User Community
www.mathworks.com/products/javabuilder www.mathworks.com/matlabcentral
Trial Software Training Services
www.mathworks.com/trialrequest www.mathworks.com/training
Sales Third-Party Products and Services
www.mathworks.com/contactsales www.mathworks.com/connections
Technical Support Worldwide Contacts
www.mathworks.com/support www.mathworks.com/contact

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

You might also like