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

1 vue (au cours des 30 derniers jours)
Diogo
Diogo le 31 Oct 2014
Commenté : Geoff Hayes le 1 Nov 2014
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 commentaire
Geoff Hayes
Geoff Hayes le 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?

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Call C++ from MATLAB dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by