Read Matlab variables from .m file to C++
Show older comments
Suppose I have a Matlab text file 'data.m' with the contents
% matlab 2x2 matrix
A=[1,2;3,4]
I would like to read the matrix A into a variable of my C++ code, something like
vector<int> v;
matlab_read<int> ("data.m", "A", &v);
I only need to parse Matlab variables, not Matlab functions.
Is there some C++ parser library or API which can do this?
(I know there is there are Matlab APIs like engine.h or mat.h, but I would rather prefer some open source library, so that people without Matlab can also run the code.)
Answers (0)
Categories
Find more on Structured Data and XML Documents in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!