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.

How export data using MATLAB Link?

Please login with a confirmed email address before reporting spam

Hi All
I need information, how I can export data by vertex using MATLAB?
Before solve my problem, first I obtain information about mesh:

nElem = model.mesh('mesh1').getNumElem;
nVertex = model.mesh('mesh1').getNumVertex;
Vertex = model.mesh('mesh1').getVertex();
Elem = model.mesh( 'mesh1').getElem('tri');

After solve problem:
model.study('std1').run;
I would like to want obtain set of data (some expression) in each of these vertex.

I dont want to use the export function
model.result.export('data1').set('filename', {NameFile});
model.result.export('data1').run;

because it generates its own mesh.

Regards

1 Reply Last Post Sep 26, 2014, 5:55 p.m. EDT
COMSOL Moderator

Hello Antoni Adapter

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.


Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Sep 26, 2014, 5:55 p.m. EDT
Antoni,
Unfortunately I dont know the answer of your question. But could you help me out to export the data that you mentioned here?
%
model.result.export('data1').set('filename', {NameFile});
model.result.export('data1').run;
%
I mean, how can I export "data1" to a csv file (or any other text formats) ?

Thanks a lot

my code:

model.result.export.create('data1', 'Data');
model.result.export('data1').setIndex('expr', 'u4', 0);
model.result.export('data1').set('filename', 'C:\Program Files\COMSOL\COMSOL44\u4.csv');
model.result.export('data1').run;
model.result.export('data1').name('u4');

Antoni, Unfortunately I dont know the answer of your question. But could you help me out to export the data that you mentioned here? % model.result.export('data1').set('filename', {NameFile}); model.result.export('data1').run; % I mean, how can I export "data1" to a csv file (or any other text formats) ? Thanks a lot my code: model.result.export.create('data1', 'Data'); model.result.export('data1').setIndex('expr', 'u4', 0); model.result.export('data1').set('filename', 'C:\Program Files\COMSOL\COMSOL44\u4.csv'); model.result.export('data1').run; model.result.export('data1').name('u4');

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.