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.

Export to Matlab - matlab.m hidden

Hi everybody,

I started to use matlab with COMSOL one year ago. I created a basic model with comsol using the GUI (see the attachement). Now I would like export this model to matlab. Here my steps :

1) - Open Comsol with Matlab ----->open My model----->File----->Export-----> Fem structure (by using the name 'TESTM');

2) -In matlab interface : 'TESTM'

I obtain :

***************************
version: [1x1 struct]
meshtime: 't'
appl: {[1x1 struct]}
geom: [1x1 solid2]
mesh: [1x1 femmesh]
sdim: {'x' 'y'}
frame: {'xy'}
shape: {'shlag(2,'u')'}
gporder: 4
cporder: 2
sshape: 2
simplify: 'on'
border: 1
form: 'coefficient'
units: [1x1 struct]
equ: [1x1 struct]
bnd: [1x1 struct]
pnt: [1x1 struct]
var: {}
expr: {}
draw: [1x1 struct]
const: {}
globalexpr: {}
functions: {}
solform: 'weak'
xmesh: [1x1 com.femlab.xmesh.Xmesh]
sol: [1x1 femsol]
**********************************************************

Unfortunately, I cannot edit the true matlab.m file corresponding to my initial model.mph. ! How retrieve this file, I mean the full matlab file.m ?

This file should be of the form :

***********
clear fem
fem.geom = square2(2,'pos',[-1 -1]) + circ2(0.4);
fem.mesh = ...
...
...
postsurf(fem,'u');

********

Thank you for your help

Luiz




0 Replies Last Post Dec 21, 2010, 11:00 AM EST
COMSOL Moderator

Hello Luiz Fernado

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.

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.