Most efficient way to exchange data between C++ and Matlab?

1 view (last 30 days)
I'm developing an application where there are two programs running at the same time: one in C++ and other in Matlab. The C++ program generates periodically three numerical values as outputs. The Matlab program needs to access the three output periodically, but in a different period time.
Currently, I've solved this using a .txt file. The C++ writes is this file when the routine is done, and the Matlab reads from it when it needs.
However, using textscan command, Matlab takes around 1.5 ms to read the .txt using a Pentium I5-4250U. So, I was wondering if there is a faster way to solve this issue.
  1 Comment
Geoff Hayes
Geoff Hayes on 1 Nov 2014
Diogo - how often (period) does the C++ program generate the 3 numeric values? Do subsequent writes occur on the same file or on a new file?

Sign in to comment.

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!