nimo
nimo

Reputation: 15

How to enable Matlab to listen real time data through C++ application

I need to create a C++ add-in to Matlab where add-in will listen to packet coming from network and notify Matlab to draw an packet analysis graph. I understood that using a MEX file I can easily call c functions inside Matlab, but I could not find a way to notify Matlab when data is available at C++ end. Is there any way we can pass a user-defined Matlab 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++.

Upvotes: 0

Views: 1665

Answers (2)

zellus
zellus

Reputation: 9582

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.

Upvotes: 1

mtrw
mtrw

Reputation: 35108

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.

Upvotes: 1

Related Questions