This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materials including this page, select Japan from the country navigator on the bottom of this page.

MATLAB Coding Guidelines

When writing MATLAB® code for deployment to MATLAB Production Server™ you must adhere to the same to the same guidelines as when writing code for deployment with MATLAB Compiler™ or MATLAB Compiler SDK™. In addition, code deployed to MATLAB Production Server must adhere to additional guidelines:

  • functions cannot depend on nor change MATLAB state.

    Functions deployed with MATLAB Production Server may not always execute on the same instance of the MATLAB Runtime. Each worker access a different MATLAB Runtime instance.

  • explicitly use varargin and varargout for functions with variable inputs and outputs.

  • avoid MATLAB figure or GUI code.

    Deployed MATLAB code runs on the server, any figures or GUIs created during runtime will show up on the server machine, not the client machine. If figures or GUIs are required to run to create the function results, make sure to close these figures at the end of your code to avoid left over windows and leaking resources on the server.

Related Topics

Was this topic helpful?