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.

how to define a variable in livelink with matlab which changes in a loop?

Please login with a confirmed email address before reporting spam

hi, I have a problem to define a loop in livelink. In the loop geometries with different shapes are created. The problem is how to define a parameter varies in loop? The .m file is attached below. Thanks!


2 Replies Last Post Aug 8, 2012, 10:27 a.m. EDT

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Aug 7, 2012, 2:19 p.m. EDT
on line 31, you have:

" i = 2:1"

This should be

"i = 1:2"

that will give i = [1 2]

I can't run your code from the console I'm at, but I'm pretty sure that's your problem.
on line 31, you have: " i = 2:1" This should be "i = 1:2" that will give i = [1 2] I can't run your code from the console I'm at, but I'm pretty sure that's your problem.

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Aug 8, 2012, 10:27 a.m. EDT
thanks!
thanks!

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.