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.
mphplot(model, 'pg1') command does not work
Posted 2015/09/17 7:38 GMT-4 Interfacing Version 5.1 8 Replies
Please login with a confirmed email address before reporting spam
I am very new user of COMSOL. I am using COMSOL 51. and COMSOL 5.1 with Matlab.
I have a comsol model in comsol GUI. It has a 2D plot with a tag <pg1>. I want to see the graph in matlab.
At first I opened Comsol with matlab. Then I wrote a code to import the comsol model. Everything works fine. But when I try to plot the graph by the command mphplot(model, 'pg1'), it shows error.
My code is like bellow
import com.comsol.model.*
import com.comsol.model.util.*
model=mphload('Rahman.mph'); %Rahman is the name of the model
info=mphsolinfo(model, 'solname', 'sol1');
tlist=info.solvals;
pd=mpheval(model, 'c'); % c is the dependent variable.
mphplot(model, 'pg1');
I would like to see the graph in matalb. But matlab is showing that there is an error in line mphplot.
Does anybody knoe how to use the mphplot command correctly?? Thanks in advance.
Please login with a confirmed email address before reporting spam
If this isn't the issue, please copy and paste the details of your error so we can have a look.
Best of luck,
Alex Mertz
Please login with a confirmed email address before reporting spam
I have saved the mph file and then I wrote command in Matlab script. But it does not show the plot rather it shows error and a blank graph (Please see attachment: Matlab_figure). But the actual plot of comsol looks like the attachment 'Comsol_figure'.
The errors are given below:
Error using strcmp
Too many input arguments
Error in mphplot/1_getPT (line 485 )
Error in mphplot/geomedgeplot (line 289)
Error in mphplot (line 223)
I used only mphplot(model, 'pg1') command. I just want to render the plot to Matlab. Do you have any suggestion why I have this kind of errors ? Thanks in advance.
Attachments:
Please login with a confirmed email address before reporting spam
This is a bug that has been fixed in our latest update, which you can get here:
www.comsol.com/product-update/5.1
Thanks for your comment.
I have saved the mph file and then I wrote command in Matlab script. But it does not show the plot rather it shows error and a blank graph (Please see attachment: Matlab_figure). But the actual plot of comsol looks like the attachment 'Comsol_figure'.
The errors are given below:
Error using strcmp
Too many input arguments
Error in mphplot/1_getPT (line 485 )
Error in mphplot/geomedgeplot (line 289)
Error in mphplot (line 223)
I used only mphplot(model, 'pg1') command. I just want to render the plot to Matlab. Do you have any suggestion why I have this kind of errors ? Thanks in advance.
--
Lars Gregersen
Comsol Denmark
Please login with a confirmed email address before reporting spam
Hi
This is a bug that has been fixed in our latest update, which you can get here:
www.comsol.com/product-update/5.1
--
Lars Gregersen
Comsol Denmark
Hi Lars
i have the latest and greatest comsol version
#Version properties.
ver.build=234
ver.major=0
ver.name=COMSOL 5.1
but still i get a error when using mphplot
% create a 3D plot group
pg = model.result.create('pg','PlotGroup3D');
%create a surface plot
surf = pg.feature.create('surf', 'Surface');
surf.set('expr', 'T');
% display the plot group
mphplot(model , 'pg')
the error is the following:
Error using strcmp
Too many input arguments.
Error in mphplot/l_getPT (line 485)
Error in mphplot/geomedgeplot (line 289)
Error in mphplot (line 223)
Please login with a confirmed email address before reporting spam
We have created a Knowledge Base entry with an attached mphplot.p file that should solve the problem. Let us know if you are still experiencing issues.
www.comsol.com/support/knowledgebase/1214/
--
Jesper Been
COMSOL Denmark
Please login with a confirmed email address before reporting spam
I've replaced the .p file, but mphplot still doesn't work. It doesn't show error message any more, but no plot is displayed either.
Please login with a confirmed email address before reporting spam
Hi there,
I've replaced the .p file, but mphplot still doesn't work. It doesn't show error message any more, but no plot is displayed either.
Hi,
There might be other issues with that plot then. I suggest you send a repeat model to support.
Please login with a confirmed email address before reporting spam
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.
Suggested Content
- FORUM mphplot + Matlab with no desktop
- KNOWLEDGE BASE Updating the COMSOL License Manager
- KNOWLEDGE BASE Error: An error has occurred. See the log file C:\Users...
- BLOG How to Use Job Sequences to Save Data After Solving Your Model
- FORUM Error in mphplot
