User`s manual
Bringing Java Classes into MATLAB
5-5
Bringing Java Classes into MATLAB
You can draw from an extensive collection of existing Java classes or create
your own class definitions to use with MATLAB. This section explains how to
go about finding the class definitions that you need or how to create classes of
your own design. Once you have the classes you need, defined in either
individual .
class files, packages, or Java Archive files, you will see how to
make them available within the MATLAB environment.
This section addresses the following topics:
•“Sources of Java Classes”
•“Defining New Java Classes”
•“Making Java Classes Available to MATLAB”
•“Loading Java Class Definitions”
•“Simplifying Java Class Names”
Sources of Java Classes
There are three main sources of Java classes that you can use in MATLAB:
•
Java built-in classes
The Java language includes general-purpose class packages, such as
java.awt. See your Java language documentation for descriptions of these
packages.
•
Third-party classes
There are a number of packages of special-purpose Java classes that you can
use.
•
User-defined classes
You can define new Java classes or subclasses of existing classes. You need
to use a Java development environment to do this, as explained in the
following section.
Defining New Java Classes
To define new Java classes and subclasses of existing classes, you must use a
Java development environment, external to MATLAB, that supports Java
version 1.1. You can download the development kit that supports the version