vb调用MATLAB

2025-01-05 16:56:47
推荐回答(1个)
回答(1):

Set Matlab = CreateObject("Matlab. Application")
这句中,matlab.和Application之间不要有空格。
还有前面要有Set,look下面:

Public Matlab As Object
Private Sub Button1_Click()
Set Matlab = CreateObject("Matlab.Application")
Call Matlab.MinimizeCommandWindow
Call Matlab.Execute("clc;a=[1,2,3;4,5,6];b=[4,5,6;1,2,3];c=a+b; ")
End Sub