Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
how can ý call matlab function from matlab to excel gurhan Excel Discussion (Misc queries) 0 November 29th 06 08:40 AM
Calling of functions Krishna@Citigroup Excel Programming 0 November 11th 04 07:58 AM
Calling functions from dll T.K Kullervo Excel Programming 0 September 29th 03 09:55 AM
Calling Add-in functions from VBA Mark[_21_] Excel Programming 5 September 12th 03 08:49 PM
Calling VBA functions from a xll Kim[_8_] Excel Programming 2 August 3rd 03 11:48 AM


All times are GMT +1. The time now is 06:35 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"