Note: This discussion is about an older version of the COMSOL Multiphysics® software. The information provided may be out of date.

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.

convert .m to .mph

Please login with a confirmed email address before reporting spam

Dear community,

Here is a little tutorial about modifying a model in Matlab and send it back in Comsol. In my humble opinion, the Comsol 4.1 LiveLink for Matlab User's Guide is not that clear about that.

1. In Comsol: File\Save As Model M-File...

2. In Comsol 4.1 with Matlab: open the .m file

3. Modify the script in Matlab (parameters, etc.)

4. Run the model in Matlab

5. Keep Comsol 4.1 with Matlab open.

6. back in Comsol: File\Import Model from Server...type the name of the model that was in the line « model = ModelUtil.create('Model'); » of the .m script. Her the name is Model by default, it also by default in the Import window.

7. That's it, your modified model is back in Comsol.

The key is the line « model = ModelUtil.create('Model'); » that you have run in Matlab. It makes Model available on the Comsol 'Server'. If you had modified the line in Matlab to « model = ModelUtil.create('Aubergine'); », then the model Aubergine would be available on the server.

Hope it helps!

1 Reply Last Post 27.08.2011, 22:18 GMT-4
COMSOL Moderator

Hello Francois Gregoire

Your Discussion has gone 30 days without a reply. If you still need help with COMSOL and have an on-subscription license, please visit our Support Center for help.

If you do not hold an on-subscription license, you may find an answer in another Discussion or in the Knowledge Base.


Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 27.08.2011, 22:18 GMT-4
Francois,

It's great. I succeed with your guide.

Thanks!

Qiao
Francois, It's great. I succeed with your guide. Thanks! Qiao

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.