Effacer les filtres
Effacer les filtres

Running MATLAB functions in vba client through automation server

4 vues (au cours des 30 derniers jours)
MFB
MFB le 24 Juil 2020
Modifié(e) : MFB le 24 Juil 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))

Réponses (0)

Catégories

En savoir plus sur Startup and Shutdown dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by