views:

74

answers:

2

Hi,

I need to create a c++ add-in to mathlab where add-in will listen to packet coming from network and notify mathlab to draw an packet analysis graph. I understood that using a MEX file I can easily call c functions inside mathlab, but I could not find a way to notify mathlab when data is available at c++ end. Is there any way we can pass a user-defined mathlab function pointer into my c++ add-in ?

btw, I found this thread real-time-data-in-matlab

Unfortunately suggestion is to use activeX control, but in my case, I need to create add-in in pure c++.

Thank you

+1  A: 

Would it make your life easier if you could listen for the network data directly from Matlab? I've never tried it, but there are a few submissions on MathWorks' File Exchange site that allow you to create sockets within Matlab. Here's a TCP/IP example that creates both a client and a server, and here's a similar UDP example.

mtrw
+1  A: 

Have a look at Gurobi. It 'just' prints status information to the command window. Using a mex command like mexCallMATLAB you may access 'any' matlab function.

zellus