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.

Matlab Link plot result with maximun parameter value

Please login with a confirmed email address before reporting spam

Hello,

I am currently working with the LiveLink with Matlab module. I have a model with several studies and therefore several data sets. Each study use a parametric resolution, and sometimes with different numbers of parameter.
I am trying to write a script that save from one plot group automatically the figures for all datasets.
So i use a for i loop.
I change dataset with : "Model.result('pg1').set('data', 'dset i')", and I use "Model.result('pg1').setIndex('looplevel' , '55' , 0) " to plot the results with de 55th value of the parameter.
I want to automatically use the last value of the parameter. I try to use "Model.result('pg1').setIndex('looplevel' , 'maximum' , 0) " but it didn't work.

Is there a way to do that?
At least is there a way to get the numbers of paramters in this dataset?

Thank you

1 Reply Last Post Jul 28, 2015, 10:00 a.m. EDT

Please login with a confirmed email address before reporting spam

Posted: 9 years ago Jul 28, 2015, 10:00 a.m. EDT
Hello,

For those who are looking for the same answer, I found a way.
You can use:

S=mpheval(Model , '1', 'dataset', 'dsetX');
s=size(S.d1);

and s(1) is the last parameter number for the Xth dataset.
Hello, For those who are looking for the same answer, I found a way. You can use: S=mpheval(Model , '1', 'dataset', 'dsetX'); s=size(S.d1); and s(1) is the last parameter number for the Xth dataset.

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.