Introduction
LiveLink™ for MATLAB® connects COMSOL Multiphysics® to the MATLAB® scripting environment. Using this functionality, you can do the following:
Set up models from a script. LiveLink™ for MATLAB® includes the COMSOL® application programming interface (API), which has all the necessary functions and methods to implement models from scratch. For each operation performed in the COMSOL Desktop® there is a corresponding command that is entered at the MATLAB prompt. It is a simplified syntax based on the Java® programming language and does not require any Java knowledge.
Leverage MATLAB functionality for program flow. Use the COMSOL API syntax together with MATLAB functionality to control the flow of your programs. For example, implement nested loops using for or while commands, implement conditional model settings with if or switch statements, or handle exceptions using try and catch.
Create custom interfaces for models. Use the MATLAB Guide or the App Designer functionality to create a user-defined graphical interface that is combined with a COMSOL model. Make your models available to others by creating graphical user interfaces tailored to expose the settings and parameters of your choice.
LiveLink™ for MATLAB® can connect to COMSOL Server™ as well as COMSOL Multiphysics server. This means that MATLAB scripts and GUIs that utilize COMSOL functionality can be distributed to and used by any user that has access to COMSOL Server™.
The examples in this guide take you through the process of setting up a COMSOL model and explain how to use COMSOL Multiphysics within the MATLAB scripting environment.