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.

Comsol with Matlab v4.1, equivalence with v3.5a POSTPLOT

Please login with a confirmed email address before reporting spam

Hi,

I am solving a heat tranfer problem with COMSOL.
Workin with v3.5a I created an *.m file in Matlab and I used the postplot function to obtain the isotherm at 3000K

H=postplot(fem, ...
'isodata',{'T','cont','internal','unit','K'}, ...
'solnum','end', ...
'outtype','postdata',...
'isodlim',[3000 3000]);

Then, in H{1}.p there were the coordinates of the cloud of points forming this isotherm.

How could I do the same thing with the new version v4.1? I need the coordinates of the points and I haven´t been able to find them in Matlab.

Thanks,

Itxaso

3 Replies Last Post Jul 4, 2011, 4:59 a.m. EDT
Lars Gregersen COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago May 26, 2011, 4:27 a.m. EDT
Hi Itxaso

Create a plot of the contour or isosurface using the Comsol Desktop.

Read the section on "Extracting Data" on page 375 of the API Reference Guide.


Lars Gregersen
Comsol Denmark
Hi Itxaso Create a plot of the contour or isosurface using the Comsol Desktop. Read the section on "Extracting Data" on page 375 of the API Reference Guide. Lars Gregersen Comsol Denmark

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Jul 1, 2011, 10:23 a.m. EDT
I have the same problem. I need to get the values of a streamline in MATLAB from an old code with COMSOL 3.5. Before I used the lines:

p=postplot(fem, ...
'flowdata',{'Er_emqv','Ez_emqv'}, ...
'flowstart',{[r0],[z0]}, ...
'solnum','end', ...
'Outtype','postdata');

but I need to do the same now in MATLAB with COMSOL 4? How can I do it? The API documentation you suggested in not really clear and may not apply to my case.

Regards

Marley
I have the same problem. I need to get the values of a streamline in MATLAB from an old code with COMSOL 3.5. Before I used the lines: p=postplot(fem, ... 'flowdata',{'Er_emqv','Ez_emqv'}, ... 'flowstart',{[r0],[z0]}, ... 'solnum','end', ... 'Outtype','postdata'); but I need to do the same now in MATLAB with COMSOL 4? How can I do it? The API documentation you suggested in not really clear and may not apply to my case. Regards Marley

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Jul 4, 2011, 4:59 a.m. EDT
Hi Marley,

I didn't find the way to get the coordinates of the points with Matlab, but if you have your model solved in Comsol 4, you can extract the data and then import them in Matlab.

In Comsol, plot the streamline. Then, under "Results" in the "Model Builder", rigth-click "Report" and select "Data". Under "Data set" select your Streamline. Choose the folder and the name you want to save it and click the "Export" button. You obtain a *.txt file containing the data that you can then import in Matlab.

That is how I got it finally. I hope this helps you.

Itxaso
Hi Marley, I didn't find the way to get the coordinates of the points with Matlab, but if you have your model solved in Comsol 4, you can extract the data and then import them in Matlab. In Comsol, plot the streamline. Then, under "Results" in the "Model Builder", rigth-click "Report" and select "Data". Under "Data set" select your Streamline. Choose the folder and the name you want to save it and click the "Export" button. You obtain a *.txt file containing the data that you can then import in Matlab. That is how I got it finally. I hope this helps you. Itxaso

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.