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 |
GMT+8, 2024-11-24 19:27 , Processed in 0.047608 second(s), 23 queries , Gzip On.
Powered by Discuz! X3.4
Copyright © 2001-2021, Tencent Cloud.