The Client/Server Architecture
LiveLink™ for MATLAB® uses the client–server mode to connect a COMSOL server and MATLAB.
The term COMSOL server designates either a COMSOL Multiphysics server or the COMSOL Server™.
When starting COMSOL with MATLAB, two processes are started — a COMSOL Multiphysics server and the MATLAB desktop. The COMSOL Desktop does not have to be started, but it is possible to have both MATLAB and COMSOL Desktop connected to the same COMSOL Multiphysics server at the same time.
The communication between the two processes is based on a TCP/IP communication protocol. You provide login information the first time COMSOL is started with MATLAB. The login information is not related to the system’s username and password. This information is stored in the user preferences file and is not required again when using COMSOL with MATLAB. The same login information can be used when exchanging the model object between the COMSOL Multiphysics server and the COMSOL Desktop.
The communication between the COMSOL server and MATLAB is established by default using port number 2036. If this port is in use, port number 2037 is used instead, and so on.
You can manually specify the port number. See the COMSOL Multiphysics Installation Guide for more information on the COMSOL server startup properties.
You can manually specify the port number. See the COMSOL Multiphysics Installation Guide for more information on the COMSOL server startup properties.
A connection can be local (on the same computer), which is the common case, or remote to a COMSOL server located on a different computer. In the latter case, you can connect MATLAB to the COMSOL server manually as described in the section Connecting a COMSOL Server and MATLAB® Manually.