I am having trouble getting the correct syntax for passing data into MatLab using Excel/VBA.
I have copied the example from the help document http://www.mathworks.com/help/techdoc/ref/putworkspacedata.html but receive the following error:
Dim Matlab As ObjectDim data(6) As DoubleDim i As IntegerMatLab = CreateObject("matlab.application")For i = 0 To 6 data(i) = i * 15Next iMatLab.PutWorkspaceData("A","base",data)MsgBox("In MATLAB, type" & vbCrLf & "A")
"Compile Error: Syntax Error" around the following line of code:
Matlab.PutWorkspaceData("A", "base", data)
What is the correct syntax for this call?
Thank You, Craig
PS. I'm using Excel 2007 with VB 6.5 and Matlab R2010a
Best Answer