MATLAB: Reading a .mat file in c/c++

.mat filec/c++readingstruct

I am reading a big .mat file in c/c++. That mat file has nested struct and depth. How can i read this file? Thanks in advance.

Best Answer

Use the mat API functions from the library (e.g., matOpen, matGetVariable, etc):
If you need to convert to/from a MATLAB struct and a C/C++ struct then you will need to copy each and every field element one-by-one (e.g., using mxGetField etc.)