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 mph functions calling a selection

Please login with a confirmed email address before reporting spam

Hi everyone,

I get into a problem, that I cant fix after half a day trying. I created a matlab instance of a comsol simulation, which I then manipulated. Now I want to access the model after I run it:

mod1 = model; mphviewselection(mod2,"geom1_csel2_dom")

but then i get the error:

"SWITCH expression must be a scalar or character vector constant."

to check that I really used the right selection tag i checked:

mod1.selection

what gives me:

"Type: List Tag: selection Child nodes: geom1_csel1_pnt, geom1_csel1_bnd, geom1_csel1_dom, geom1_csel2_pnt, geom1_csel2_bnd, geom1_csel2_dom"

so the reference does exist, but somehow it cant access it... I tried many things, but can't find a solution. I hope you can help me out of this?

Best, Joel


0 Replies Last Post 8 ago 2018, 12:03 GMT-4
COMSOL Moderator

Hello Joel Winiger

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.

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.