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.

Running m-file from Comsol

Please login with a confirmed email address before reporting spam

Hello All,

This maybe a result of my low experience with Matlab. My end goal is to convert my Comsol MPH files to M-Files to be run on a cluster. I would be happy if I could first save a MPH file as an M-file and successfully run it in Matlab. This should be simple, but apparently I am doing something wrong.

Say I set up a simple RF scattering situation. I have my Comsol file all set, mesh generated, parameter sweep in place, boundary, and sub domains ready, etc. All I need to do in Comsol is press solve and things work beautifully. I was under the impression that I could save this file as an M-file, open it in Matlab and compute the solutions in the m-file.

Is this wrong? Do I have to change something in the M-file before it computes solutions.

1 Reply Last Post 13 gen 2010, 23:39 GMT-5
Ivar KJELBERG COMSOL Multiphysics(r) fan, retired, former "Senior Expert" at CSEM SA (CH)

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 13 gen 2010, 23:39 GMT-5
Hi

have you tried to save your file as a ".m" file from the GUI ? (in V3.5a its still there).

But you can aslo, open matlab, linked to Comsol, call up COMSOL (or call Matlab from COMSOL if your install settings were OK) run the mph file, export the fem structure to matlab (CNTRL-F) and tweak the data from matlab, and if needed resend back to COMSOL for standard post-processing.

take a look at te mlinterface.pdf doc

Good luck
Ivar

Hi have you tried to save your file as a ".m" file from the GUI ? (in V3.5a its still there). But you can aslo, open matlab, linked to Comsol, call up COMSOL (or call Matlab from COMSOL if your install settings were OK) run the mph file, export the fem structure to matlab (CNTRL-F) and tweak the data from matlab, and if needed resend back to COMSOL for standard post-processing. take a look at te mlinterface.pdf doc Good luck Ivar

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.