Quantcast
Channel: Latest Discussions - COMSOL Forums
Viewing all articles
Browse latest Browse all 26527

convert .m to .mph

$
0
0
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!

Viewing all articles
Browse latest Browse all 26527

Trending Articles