Java Client Programming

Create client programs in Java®

The MATLAB® Production Server™ Java client API allows you to evaluate MATLAB functions on remote servers using native Java data. You can choose to two styles of API to evaluate a MATLAB function:

  • static proxy — you provide an interface that models the MATLAB function signature. This enforces passing the proper data types to the function at compile time.

  • dynamic proxy — you pass the function name as a parameter to the proxy along with the function arguments. This defers type checking until runtime.

For an overview of how to create client programs, see Create a Java MATLAB Production Server Client.

For a complete example of a client implementation, see Create a Java Client.

Examples and How To

Create a Java MATLAB Production Server Client

To create a MATLAB Production Server client in Java:

Configure the Client-Server Connection

You configure the client-server connection using an object that implements the MWHttpClientConfig interface.

Invoke MATLAB Functions Dynamically

Invoke MATLAB functions using a function name and argument list.

Access Secure Programs Using HTTPS

Connecting to a MATLAB Production Server instance over HTTPS provides a secure channel for executing MATLAB functions.

Customize Security Configuration

The MWSSLConfig object provides information to configure HTTPS.

Bond Pricing Tool for Java Client

This example shows an application that calculates a bond price from a simple formula.

Code Multiple Outputs for Java Client

MATLAB allows users to write functions that return multiple outputs.

Code Variable-Length Inputs and Outputs for Java Client

MATLAB supports functions with both variable number of input arguments (varargin) and variable number of output arguments (varargout).

Marshal MATLAB Structures (Structs) in Java

Structures (or structs) are MATLAB arrays with elements accessed by textual field designators.

Concepts

Unsupported MATLAB Data Types for Client and Server Marshaling

MATLAB data types that are not supported for client and server marshaling

Java Client Coding Best Practices

When you write Java interfaces to invoke MATLAB code, remember these considerations:

Data Conversion with Java and MATLAB Types

There are many data types that you can work with in MATLAB.

Conversion of Java Types to MATLAB Types

Rules for data conversion from Java to MATLAB types

Conversion of MATLAB Types to Java Types

Was this topic helpful?