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
Posted 2011年7月8日 GMT-4 12:35 Interfacing, General, LiveLink for MATLAB Version 4.1 1 Reply
Please login with a confirmed email address before reporting spam
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!
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.