"matfile" function does not fetch variables with multiple fields?

1 回表示 (過去 30 日間)
cui,xingxing
cui,xingxing 2022 年 5 月 30 日
コメント済み: cui,xingxing 2022 年 5 月 30 日
I have a very big mat file(about 2 GB),in which there are several hierarchical relationships, there is an array of variables occupy a lot of memory, such as matObj.field.sub1.sub2.var, in the "var" occupies a lot of space, it is not convenient to import into matlab at once, so I use the matfile function to parse, size function to determine the size of var, I tried to use size( matObj,'field.sub1.sub2.var') to judge, but it will report an error, field.sub1.sub2.var is not a variable of matObj. How can I solve the problem efficiently? I'd appreciate your answer!

採用された回答

Walter Roberson
Walter Roberson 2022 年 5 月 30 日
You cannot. Only entire variables can be inquired about. You would have to load the variable to determine the size of the field.
I suggest that you store the sizes into a variable at the time you write the data into the file.
  1 件のコメント
cui,xingxing
cui,xingxing 2022 年 5 月 30 日
Not the best way, but thanks for your answer.

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

その他の回答 (0 件)

カテゴリ

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

タグ

製品


リリース

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by