Manually connecting MATLAB® to a COMSOL
server can be useful if you want to start a MATLAB standalone and then connect to a COMSOL
server, or if you need to connect MATLAB and a COMSOL
server running on different computers. LiveLink™
for MATLAB® provides the function
mphstart to operate the client/server connection. This section contains the instruction to follow to connect MATLAB to either a COMSOL Multiphysics Server or the COMSOL Server™.
where <portnumber> is an integer corresponding to the port used by the COMSOL
server.
To connect MATLAB and a COMSOL server that are running on different computers, specify the IP address of the computer where the COMSOL
server is running in the function
mphstart:
<ipaddress> can also be defined with the COMSOL
server domain name.
where <comsolpath> is the path of the COMSOL installation folder.
Once MATLAB and the COMSOL server are manually connected, import the COMSOL class by entering the following command at the MATLAB prompt:
To disconnect MATLAB and the COMSOL server, run this command at the MATLAB prompt: