如何调用matlab中的循环语句?(100分)

L

lzw

Unregistered / Unconfirmed
GUEST, unregistred user!
我使用如下语句,但根本不执行
matlab.execute('for i=1:2');
matlab.execute('for j=1:2');
matlab.execute('k(i,j)=i+j');
matlab.execute('end');
matlab.execute('end');
 
还有,我执行以下语句,
matlab.PutFullMatrix('km','base',k,tmp);
错误:type not allowed in ole automation call
why?
 
没有人研究这方面的问题吗?我觉得还是很有用的。
 
lzw:你的问题已经过期,要继续请提前,否则要被强制结束了,谢谢
 
var
MatLab: Variant;
begin
Matlab:=CreateOleObject('Matlab.Application');
memo1.text:=Matlab.Execute(memo1.Text);
end;

你可以在memo1的text里写成“for i=1:2
for j=2:3
k(i,j)=i+j
end
end”
OK!
 

Similar threads

顶部