matlab中的link,MATLAB LiveLink

Please login with a confirmed email address before reporting spam

Send a report to the moderators

Cancel

Report

Hey there,

I am using LiveLink MATLAB but when running my model, the notice "Undefined function or variable 'mphopen'" is emerged on the command window. However, I have set up the file "domain_activation_llmatlab" in the MATLAB path. could it be some problem related to LiveLinke? How could I find it that my COMSOL 5.2a can LiveLink to the MATLAM R2016a.

this is one of the comsol's sample problems (www.comsol.com/model/domain-activation-and-deactivation-12060). I, however, cannot do this. what do you suggest. the MATLAB code is as follows:

------------------

model = mphopen('domain_activation_llmatlab');

domInd = [2,3,5,4];

ht = model.physics('ht');

for i = 1:8

k = mod(i,4);

if k == 0

k = 4;

end

ht.selection.set([1 domInd(k)]);

ht.feature('init2').selection.set(domInd(k));

model.study('std1').run;

if i==1

cpt1 = model.result.dataset.create('cpt1', 'CutPoint3D');

cpt1.set('pointx', '0 L/2 L');

cpt1.set('pointy', '0 L/2 L');

cpt1.set('pointz', 'L/10');

pg1 = model.result.create('pg1', 'PlotGroup1D');

pg1.set('data', 'cpt1');

ptgr1 = pg1.feature.create('ptgr1', 'PointGraph');

ptgr1.set('legend', 'on');

pg2 = model.result.create('pg2', 'PlotGroup3D');

surf1 = pg2.feature.create('surf1', 'Surface');

surf1.set('rangecoloractive', 'on');

surf1.set('rangecolormax', '336');

surf1.set('rangecolormin', '293.15');

ht.feature('init1').set('T', 1, 'T');

v1 = model.sol('sol1').feature('v1');

v1.set('initsol', 'sol1');

end

figure(1)

mphplot(model,'pg1','rangenum',1)

hold on

figure(2)

subplot(4,2,i)

pg2.setIndex('looplevel','25',0);

mphplot(model,'pg2');

time = mphglobal(model,'t','solnum','end');

model.param.set('t0',time);

disp(sprintf('End of iteration No.%d',i));

end

----------------------

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值