Discussion Closed This discussion was created more than 6 months ago and has been closed. To start a new discussion with a link back to this one, click here.

COMSOL 4.0 livelink to matlab

Please login with a confirmed email address before reporting spam

Hi everybody,

I'm trying to use a MATLAB function which I built in one of my material's properties in a heat transfer problem, but I just don't understand how to use the livelink to matlab.
I have the icon "COMSOL 4.0 with MATLAB", and when I double click it opens MATLAB. what do I do next?
am I supposed to work with matlab only? how do I do that?
when I worked with MATLAB and COMSOL 3.5a, they both opened and I worked just on COMSOL itself.

thank you all,
Yael.

1 Reply Last Post 27 juil. 2010, 09:40 UTC−4

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 27 juil. 2010, 09:40 UTC−4
Start by reading the LiveLink for Matlab user's guide that comes with the Comsol 4.0 installation. One way to start is to create a model in Comsol, then save it as a model m-file. Then, you can open the m-file in Matlab and start to see how to construct the appropriate commands to interact with Comsol. There is also an API Reference Guide, which will help to decipher the m-code that is generated.

If you are using Comsol 4.0a, you can actually start Matlab by itself, then add the path the the Comsol\mli directory and issue the command 'mphstart'. This will then open a comsolserver and connect your Matlab session to it. All of this is explained in the LiveLink for Matlab user's guide.

Good luck.
Start by reading the LiveLink for Matlab user's guide that comes with the Comsol 4.0 installation. One way to start is to create a model in Comsol, then save it as a model m-file. Then, you can open the m-file in Matlab and start to see how to construct the appropriate commands to interact with Comsol. There is also an API Reference Guide, which will help to decipher the m-code that is generated. If you are using Comsol 4.0a, you can actually start Matlab by itself, then add the path the the Comsol\mli directory and issue the command 'mphstart'. This will then open a comsolserver and connect your Matlab session to it. All of this is explained in the LiveLink for Matlab user's guide. Good luck.

Note that while COMSOL employees may participate in the discussion forum, COMSOL® software users who are on-subscription should submit their questions via the Support Center for a more comprehensive response from the Technical Support team.