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.
Assigning materials to domains from MATLAB
Posted 22.07.2011, 10:17 GMT-4 Interfacing, Geometry, Materials Version 5.2a 3 Replies
Please login with a confirmed email address before reporting spam
I am wondering how to assign materials to domains from a matlab script. For example, I create a block "my_block" with
>> model.geom('geom1').feature.create('my_block', 'Block');
>> ... % define the properties of block here
Then I create a material called "superconductor" with
>> model.material.create('superconductor');
Now, if I assign the "my_block" to material "superconductor" through COMSOL GUI and save the result as m file, the assignment will look like this:
>> model.material('superconductor').selection.set([1]);
How do I find out programatically the correspondence between "my_block" and the number 1 that I need to specify as the parameter to the last command.
Thanks in advance,
Andrey
Hello Andrey Zhdanov
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.