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.
Evaluate Matlab-Function in Model-Parameter: example in LiveLink documentation seems not to work
Posted 17 août 2011, 08:36 UTC−4 Interfacing Version 4.2 0 Replies
Please login with a confirmed email address before reporting spam
i'm trying to to run the following example (page 33, LiveLink for Matlab User Guide):
import com.comsol.model.*;
import com.comsol.model.util.*;
model = ModelUtil.create('Model');
model.func.create('extm1', 'MATLAB');
model.func('extm1').setIndex('funcs', 'my_fun', 0, 0);
model.func('extm1').setIndex('funcs', 'x, y', 0, 1);
model.param.set('E0', 'my_fun(x,y)');
This should get me the return value of the evaluated Matlab function stored in parameter E0.
But with
model.param.get('E0')
the system just returns
ans = my_fun(x,y)
instead of the parameter value. Any ideas what i've done wrong?
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.