马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?我要加入
x
var
V : Variant;
MReal : OleVariant;
MImage : OleVariant;
begin
i,j : integer;
MReal := VarArrayCreate([0, 1, 0, 3], varDouble);
MImage := VarArrayCreate([0,0,0,0], varDouble);
V := CreateOLEObject('Matlab.Application');
V.Execute('a=[1 2 3 4; 5 6 7 8]');
V.GetFullMatrix('a','base',VarArrayRef(MReal),VararrayRef(MImage));
for i := 0 to 1 do
for j := 0 to 3 do
Stringgrid1.Cells[j,i] := MReal[i,j];
V.Execute('peaks');
MReal := VarArrayCreate([0, 1, 0, 3], varDouble);
MImage := VarArrayCreate([0,0,0,0], varDouble);
for i := 0 to 1 do
for j := 0 to 3 do
MReal[i,j] := i+4;
V.PutFullmatrix('b','base',VarArrayRef(MReal),VararrayRef(MImage));
end |