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 use Comsol interpolation function in Matlab?

Please login with a confirmed email address before reporting spam

Hello everybody,
I've build an interpolation function in Comsol and it looks like this:

model.func.create('int1', 'Interpolation');
model.func('int1').set('table', {'0.1750' '4.2763'; '0.1950' '4.1898'; '0.2150' '4.1507'; '0.2350' '4.133'; '0.2550' '4.1248'; '0.2750' '4.1209'; '0.2950' '4.119'; '0.3150' '4.1179'; '0.3350' '4.1171'; '0.3550' '4.1165'; ...
'0.3750' '4.116'; '0.3950' '4.1153'; '0.4150' '4.1145'; '0.4350' '4.1135'; '0.4550' '4.1121'; '0.4750' '4.1099'; '0.4950' '4.1066'; '0.5150' '4.1014'; '0.5350' '4.0934'; '0.5550' '4.082'; ...
'0.5750' '4.067'; '0.5950' '4.05'; '0.6150' '4.0333'; '0.6350' '4.0192'; '0.6550' '4.0087'; '0.6750' '4.0012'; '0.6950' '3.996'; '0.7150' '3.9923'; '0.7350' '3.9893'; '0.7550' '3.9867'; ...
'0.7750' '3.9841'; '0.7950' '3.9813'; '0.8150' '3.9783'; '0.8350' '3.9747'; '0.8550' '3.9705'; '0.8750' '3.9652'; '0.8950' '3.9585'; '0.9150' '3.9493'; '0.9350' '3.9361'; '0.9550' '3.9144'; ...
'0.9750' '3.869'; '0.9950' '3.5944'});

Now,i want to call the int1 function in Matlab. for example, if i want to get 4.2763 (the first value) , i will use " int1(0.1750) " in comsol, but i don't know how to get 4.2763 in Matlab and which function can meet my purpose?

Thanks for your help!



Best Regards,
lijun

0 Replies Last Post Dec 15, 2014, 11:06 p.m. EST
COMSOL Moderator

Hello Li Jun

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.