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.
Increment of Variable/Argument name used in Function
Posted 2011年4月27日 GMT-4 14:14 Interfacing, Parameters, Variables, & Functions Version 4.1 3 Replies
Please login with a confirmed email address before reporting spam
Hi,
I'm trying to increment variable name in a command:
___________________
ie: model.geom('geom1').feature.create('b1', 'BezierPolygon');
Here I'll like to increment 'b1' each time loop is passing over this command (considering the command into a if loop per example)
____________________
Usually, I use evalc to increment matrix name in Matlab:
____________________
for i=1:10
evalc(['b' num2str(i) '=zeros(N,N)'])
end
____________________
Here it doesn't work, since Matlat interpret this as an undefined variable (since I do not assign anything to the variable)
I'm sur it is not complicated !
Any help would be appreciated.
I'm trying to increment variable name in a command:
___________________
ie: model.geom('geom1').feature.create('b1', 'BezierPolygon');
Here I'll like to increment 'b1' each time loop is passing over this command (considering the command into a if loop per example)
____________________
Usually, I use evalc to increment matrix name in Matlab:
____________________
for i=1:10
evalc(['b' num2str(i) '=zeros(N,N)'])
end
____________________
Here it doesn't work, since Matlat interpret this as an undefined variable (since I do not assign anything to the variable)
I'm sur it is not complicated !
Any help would be appreciated.
3 Replies Last Post 2011年4月28日 GMT-4 20:48