Hauptinhalt

Call Python from MATLAB for Wireless

R2026b
Since R2026a

Before you can run wireless simulations that use PyTorch® or TensorFlow™ models, you must first configure your computer to use Python® from MATLAB®. To install a supported python implementation on your computer, see Set Up Python Environment for Deep Learning with PyTorch Workflows (Deep Learning Toolbox) and Use PyTorch and MATLAB for Deep Learning Workflows (Deep Learning Toolbox).

Once you have configured your computer and your MATLAB environment, you can then:

MATLAB can run Python code in two execution modes:

  • "InProcess" — Runs Python within the MATLAB process. This mode provides the best performance by eliminating interprocess communication overhead. Use this mode for production workflows.

  • "OutOfProcess" — Runs Python in a separate process. This mode allows you to restart the Python environment without restarting MATLAB, which is useful when debugging or iterating on environment configuration.

For more information, see Configure Environment for PyTorch Interface (Deep Learning Toolbox).

Wireless Workflows with MATLAB calling Python

These examples show AI for wireless applications with MATLAB calling Python to run PyTorch models.

Data Preparation

Model Training

Model Testing

Each example includes a requirements supporting file to identify the Python libraries that you need and their specific versions. You can use the requirements files with the pip command line program to install all the required libraries. For more information, see https://pip.pypa.io/en/stable/user_guide/.

See Also

|

Topics