Borrar filtros
Borrar filtros

Running MATLAB functions in vba client through automation server

4 visualizaciones (últimos 30 días)
MFB
MFB el 24 de Jul. de 2020
Editada: MFB el 24 de Jul. de 2020
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))

Respuestas (0)

Categorías

Más información sobre Startup and Shutdown en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by