How do I append data to a MAT file from C++?
Ältere Kommentare anzeigen
From a C++ program, I would like to continuously append data to a MAT file while the program runs. The program doesn't have to append to an existing file, but after creating the file at the beginning the program needs to append save data to the MAT file over long periods of time. mxCreateNumericMatrix appears to require the size of the variable to be known with no options to append. The program cannot keep all the data in memory and then write it upon completion.
Thanks!
1 Kommentar
shuangshuang kong
am 15 Apr. 2018
have you solve this problem yet? can you tell me how to do?because i have also met such problem,and i dont know how to figure it out.
Akzeptierte Antwort
Weitere Antworten (2)
Adam Hug
am 30 Jun. 2015
0 Stimmen
I think your best bet will be to use MATLAB Engine. This is an API that lets you run MATLAB commands using C/Fortran programs. See the following doc link for more information and examples:
1 Kommentar
Sean de Wolski
am 1 Jul. 2015
One could also use MATLAB Compiler based executables or libraries for this.
Muthu Annamalai
am 1 Jul. 2015
Bearbeitet: Muthu Annamalai
am 1 Jul. 2015
0 Stimmen
The two alternatives are nicely laid out by Adam, and James.
- Adam's recommendation is to use the Mex API.
- James's recommendation is to use the load(), csvload() like commands from MATLAB
I think following James's approach maybe quicker, and all you need in the short run.
Kategorien
Mehr zu Whos finden Sie in Hilfe-Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!