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.

Saving Comsol models as m-files!

Please login with a confirmed email address before reporting spam

Hi,

I've been trying to save my model in COMSOL az a m-file. However, it's saved as a function in Matlab instead of a script.
Consequently, after running the file in Matlab I get this message,

Type: Root
Tag: Model
Identifier: root

Moreover, I'm running Comsol 4.0a with Matlab R2011a. I'm wondering if there is any compatibility issue or something else is wrong!

Thank you in advance,
Azadeh

1 Reply Last Post Aug 26, 2011, 6:24 a.m. EDT

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Aug 26, 2011, 6:24 a.m. EDT
Hi,
I think Matlab gives you back your evaluated/solved Comsol model as a data struct. So you could extract your information in Matlab by looking into the datafields of the struct that is in ans. Or call your function in Matlab like:

myResult = myFunction;

Then all your results are stored in myResult.
Hi, I think Matlab gives you back your evaluated/solved Comsol model as a data struct. So you could extract your information in Matlab by looking into the datafields of the struct that is in ans. Or call your function in Matlab like: myResult = myFunction; Then all your results are stored in myResult.

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.