Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
DDE - calling Matlab Functions
Hi,
Does anyone know how to call and pass values to a function or sub in Matlab? I can currently pass values directly to the workspace and execute a .m file which references these varaibles (thus haing a similar effect) using a DDE connection, but I can't seem to call a function as I would if I were in Matlab itself. I have tried the following code in VBA: Application.DDEExecute channel, "valueSwap_vanilla(" & variable & ")" But it doesn't work! Any suggestions...Thanks very much in advance. Noel |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
DDE - calling Matlab Functions
Hi, I have found the solution to the problem. So just to inform anyone who
might be interested - it is possible to create a Matlab Application Object (you'll need to reference the Matlab Library "Matlab Automation Server Type Library" ), on which one can call the "Execute" Member Function which can be used to call a user defined function and pass values (as strings) to it. For example, Set m_MatlabApp = CreateObject("Matlab.Application") m_MatlabApp.Execute "y = value(" & a & "," & v & ")" There is a breif discussion on the pros and cons of this method at http://groups.google.ca/group/comp.s...ction&rnum= 7 Hope this helps... "Noel" wrote: Hi, Does anyone know how to call and pass values to a function or sub in Matlab? I can currently pass values directly to the workspace and execute a .m file which references these varaibles (thus haing a similar effect) using a DDE connection, but I can't seem to call a function as I would if I were in Matlab itself. I have tried the following code in VBA: Application.DDEExecute channel, "valueSwap_vanilla(" & variable & ")" But it doesn't work! Any suggestions...Thanks very much in advance. Noel |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
how can ý call matlab function from matlab to excel | Excel Discussion (Misc queries) | |||
Calling of functions | Excel Programming | |||
Calling functions from dll | Excel Programming | |||
Calling Add-in functions from VBA | Excel Programming | |||
Calling VBA functions from a xll | Excel Programming |