Reading a .mat file in c/c++

3 ビュー (過去 30 日間)
Farik John
Farik John 2015 年 12 月 17 日
コメント済み: Tharun M 2016 年 5 月 18 日
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.

採用された回答

James Tursa
James Tursa 2015 年 12 月 17 日
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 件のコメント
James Tursa
James Tursa 2015 年 12 月 22 日
What do you specifically mean by "4 depth" mat-file? A mat file simply has variables in it. The variables could be anything. I.e., structs that contain structs that contain structs etc. Is that what you mean by "4 depth", that some of the variables are structs 4 levels deep? If so, then you need to extract that info level-by-level manually in your C/C++ code to work with it (e.g., using mxGetField, followed by another mxGetField, followed by another mxGetField, etc).
Tharun M
Tharun M 2016 年 5 月 18 日
Can you tell me where to find this api? Unable to find it to download it anywhere

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeWorkspace Variables and MAT-Files についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by