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.

Matlab interface

Please login with a confirmed email address before reporting spam

I would want to know how I can export a Comsol file in Matlab.
I have an image in Comsol and I want to process it in Matlab because I want to obtain the distribution-in-angle of a pressure wave. Do you know if I can obtain it by Comsol postprocessing?
Thank you!
Ramona

2 Replies Last Post Oct 8, 2009, 6:43 p.m. EDT
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: 2 decades ago Oct 8, 2009, 4:58 p.m. EDT
Hi

the access to matlab from COMSOL requires both installed on the same PC, the matlab path has to be given to the COMSOL installation procedure, then you can connect to matlab from within comsol, or start matlab from the comsol start command (read through the installation guide).

The fem model, once solved in COMSOL can be imported into matlab with the CNTRL F command (inside comsol.

Nevertheless, you need to study the matlab commands on how to extract the data from the "fem" structure. This require further reading of the doc and some test to get aquinted with the format. You can also study the "history.m" files created from your GUI commands in COMSOL.


There is still the "poor-man's" way too: i.e. make a Postprocessing Plot of the desired value(s) and export the plot data into an "ascii text file" from the plot window, this data can then be imported into matlab, or Excel or whatever.

Hope it helps
Good luck
Ivar
Hi the access to matlab from COMSOL requires both installed on the same PC, the matlab path has to be given to the COMSOL installation procedure, then you can connect to matlab from within comsol, or start matlab from the comsol start command (read through the installation guide). The fem model, once solved in COMSOL can be imported into matlab with the CNTRL F command (inside comsol. Nevertheless, you need to study the matlab commands on how to extract the data from the "fem" structure. This require further reading of the doc and some test to get aquinted with the format. You can also study the "history.m" files created from your GUI commands in COMSOL. There is still the "poor-man's" way too: i.e. make a Postprocessing Plot of the desired value(s) and export the plot data into an "ascii text file" from the plot window, this data can then be imported into matlab, or Excel or whatever. Hope it helps Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 2 decades ago Oct 8, 2009, 6:43 p.m. EDT
When ever you have both Comsol and Matlab in your PC, you can connect to Matlab from File menu, then you need to go to Plot Parameters and choose from "Plot in" menu Matlab option. Now when ever you are ploting something it will come up as Matlab figure.

When ever you have both Comsol and Matlab in your PC, you can connect to Matlab from File menu, then you need to go to Plot Parameters and choose from "Plot in" menu Matlab option. Now when ever you are ploting something it will come up as Matlab figure.

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.