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.

livelink pgtag for existing plots

Please login with a confirmed email address before reporting spam

Hi, I want to export my plots from comsol to matlab, to tweak and export them as eps. I am using comsol 4.4.

The plots are already made in the comsol model, and I have loaded the model up in matlab. The "mphplot" command takes an argument <pgtag>, which corresponds to a plotgroup. I understand that when you make a plotgroup through matlab, you need to give it a pgtag. But how do I check the pgtag values of the plotgroups I have already made in COMSOL desktop? Thanks.

Edit: also a second problem: when running the server with "comsol server matlab -graphics", no graphical interface opens, is this intended and I've misunderstood? I would like to open Comsol and matlab concurrently and modify/access the model through both interfaces. Is this possible?

3 Replies Last Post 2014年12月1日 GMT-5 06:03

Please login with a confirmed email address before reporting spam

Posted: 10 years ago 2014年11月11日 GMT-5 06:10
The solution that I found for this problem is that I can save the comsol model as a .m file and check the pgtags from there. As a step-by-step guide for plotting existing comsol plots in matlab:

* Save the comsol model as *.m
* Find the corresponding tags to the relevant plots in the .m file (you can search for the plot group name, for example)
* Open comsol with matlab (e.g. $comsol44 server matlab)
* load the model with >model = mphload('model_filename');
* plot the graphs with >mphplot(model, 'tag');

Might be a little cumbersome, but is sufficient for my usage.
The solution that I found for this problem is that I can save the comsol model as a .m file and check the pgtags from there. As a step-by-step guide for plotting existing comsol plots in matlab: * Save the comsol model as *.m * Find the corresponding tags to the relevant plots in the .m file (you can search for the plot group name, for example) * Open comsol with matlab (e.g. $comsol44 server matlab) * load the model with >model = mphload('model_filename'); * plot the graphs with >mphplot(model, 'tag'); Might be a little cumbersome, but is sufficient for my usage.

Please login with a confirmed email address before reporting spam

Posted: 10 years ago 2014年11月12日 GMT-5 07:16
At the Comsol GUI, right click over the Plot Group node and select Properties.

There you will see the pgtag that is a string of the type 'pg1' or 'pg2'.

Hope that helps,

Felipe Beltran-Mejia
At the Comsol GUI, right click over the Plot Group node and select Properties. There you will see the pgtag that is a string of the type 'pg1' or 'pg2'. Hope that helps, Felipe Beltran-Mejia

Please login with a confirmed email address before reporting spam

Posted: 10 years ago 2014年12月1日 GMT-5 06:03
Ah, thanks, yes, that is more convenient.
Ah, thanks, yes, that is more convenient.

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.