VBA with Matlab using Excel Link but not Excel Builder

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I need to use VBA to get Matlab calculations into Excel; I have the Excel
link but not the Excel builder for Matlab.

Many Thanks
 
Thanks for your help earlier. I now have I second problem. I need to use to
use the MatLab GARCH toolbox to ouput results to excel, the following code
dosn't error but dosn't return the results:


MLPutMatrix "A", Application.Selection
Excllink.MatlabRequest

Excllink.MLEvalString "A = garchfit(A)"
Excllink.MatlabRequest

MLGetMatrix "A", "D3"
Excllink.MatlabRequest

Thanks in advance
 
Hi James,

my experience tells me that you require the MatlabRequest only gor the
MLGetMatrix. Anyway, that apart, which oart isn't working. Is it the Put
matrix, the evalstring, or the get matrix. Debug step-by-step. Also check if
your matlab path is correct.

Mangesh
 
Thanks,

The problem is with the MLGetMatrix command. When I run the code and then
type 'A' into the MatLab command window, it returns the results as expected.
The problem is that the code dosn't output these results to Excel.

Thanks,

James
 
Hi James,

This is exactly how I use the two statements:

Call getData("A", "D3")


Sub getData(matlabVar, excelRange)
MLGetMatrix matlabVar, excelRange
matlabrequest
End Sub

With so little information won't be able to help much. Maybe you could make
a small example and try to post the code, and I could check it out on my
end.

Mangesh
 
Thanks,

Would it be possible to send you the code as an attachment?

Best Regards,

James
 
send at (e-mail address removed)
don't forget to remove the part in caps from the email id.
You could send a small matlab file and your excel file which would be easy
for me to debug. Maybe you could prepare a small example to read a value
from excel, manipulate it in matlab, and send back to excel.

Mangesh
 
Back
Top