MATLAB读入VB变量出错 这段代码哪里不对?
Private Sub Command1_Click()Dim Matlab As Object
Dim pReal(1, 1) As Variant
Dim plmag() As Variant
Dim result As String
Dim i As Integer, j As Integer
Dim dataIn(1, 1) As Variant
'Rem数组赋值
For i = 0 To 1
For j = 0 To 1
pReal(i, j) = i + j
Next
Next
' Rem开启Matlab自动化服务器
Set Matlab = CreateObject("Matlab.Application")
' Rem向Matlab输入数据
Call Matlab.PutFullMatrix("dataIn", "base", pReal, plmag) 这行显示不匹配怎么回事
'Rem执行计算 (其问调用Matlab的求逆函数)
result = Matlab.Execute("dataOut=inv(dataIn)")
' Rem返回数据
Call Matlab.GetFullMatrix("dataOut", "base", pReal, plmag)