필터 지우기
필터 지우기

Running MATLAB functions in vba client through automation server

조회 수: 1 (최근 30일)
MFB
MFB 2020년 7월 24일
편집: MFB 2020년 7월 24일
Sub Main()
Dim Matlab As Object
Dim Xreal(143,1) As Double
Dim Ximag(143,1) As Double
Dim result As String
Dim i,j As Integer
Set Matlab = CreateObject("matlab.application")
MsgBox("wait for the prompt....")
Matlab.Execute("rng 'shuffle';")
Matlab.Execute("p = sobolset(2,'Skip',1e3,'Leap',1e2);")
Matlab.Execute("p = scramble(p,'MatousekAffineOwen');")
result = Matlab.Execute("X0 = net(p,144));")
Matlab.GetFullMatrix("X0","base",Xreal,Ximag)
For i = 0 To 143
For j = 0 To 1
ReportInformationToWindow(Xreal(i,j))
Next
Next
End Sub
I am running this code in order to execute MATLAB functions from VBA client. I am unable to get values from MATLAB automation server. It produces error:
Error in macro execution, please check:
(&H80020009) Exception 80020009
(Matlab.GetFullMatrix("X0","base",Xreal,Ximag))

답변 (0개)

카테고리

Help CenterFile Exchange에서 Installation에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by