Create a Java MATLAB Production Server Client

To create a MATLAB® Production Server™ client in Java®:

  1. Obtain mps_client.jar from $MPS_INSTALL/client.

  2. Configure your development environment to use mps_client.jar.

  3. Based on your requirements, decide if the client uses a static proxy or a dynamic proxy.

    • A static proxy uses an object implementing an interface that mirrors the deployed MATLAB functions. You provide the interface for the static proxy.

      See Static Proxy Interface Guidelines.

    • A dynamic proxy creates server requests based on the MATLAB function name provided to the invoke() method. You provide the function name, the number of output arguments, and all of the input arguments required to evaluate the functions.

      See Invoke MATLAB Functions Dynamically.

  4. Write a the Java code to instantiate a proxy to a MATLAB Production Server instance and call the MATLAB functions.

    1. Create an MWClient object for communicating with the service hosted by a MATLAB Production Server instance.

    2. Create MATLAB data structures to hold the data passed between the client and server.

    3. Invoke MATLAB functions.

    4. Free system resources using the close method of the MWClient object.

Was this topic helpful?