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.

creating geometry in matlab-function different from current matlab-function

Please login with a confirmed email address before reporting spam

Hi,
i'm tying to use an external matlab-function to create a certain geometry and then assign this geometry to my current model in matlab.

Unfortunately something like the following doesn't work:
model.geometry('myGeometry') = geometryCreationMatlabFunction(param1,param2);

I couldn't find any feature that allows me to import/copy/assign geometries from model B into an existing comsol model A (i also want to avoid saving the geometry as a file and then reimport the whole stuff).
Is there an easy way to get this done?



Udate:
I finally figured out how to do it. All you need to to is create a model in the curent m-file. Then give this model as argument to the external m-file. The external m-file now does something with the model like setting up geometry etc. After that it gives back the model as return value. Thats all :)

1 Reply Last Post Oct 19, 2016, 1:35 p.m. EDT
COMSOL Moderator

Hello Chris Shor

Your Discussion has gone 30 days without a reply. If you still need help with COMSOL and have an on-subscription license, please visit our Support Center for help.

If you do not hold an on-subscription license, you may find an answer in another Discussion or in the Knowledge Base.


Please login with a confirmed email address before reporting spam

Posted: 8 years ago Oct 19, 2016, 1:35 p.m. EDT
Hi,

I am also trying to define geometry function in Matlab. Can you please help me out. I saw your post so thought of asking for help if you have figured it out.
Hi, I am also trying to define geometry function in Matlab. Can you please help me out. I saw your post so thought of asking for help if you have figured it out.

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.