MATLAB Answers

Reading a .mat file in c/c++

17 views (last 30 days)
Farik John
Farik John on 17 Dec 2015
Commented: Tharun M on 18 May 2016
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.

Accepted Answer

James Tursa
James Tursa on 17 Dec 2015
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.)
  5 Comments
Tharun M
Tharun M on 18 May 2016
Can you tell me where to find this api? Unable to find it to download it anywhere

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!