フィルターのクリア

How to index structures name

3 ビュー (過去 30 日間)
Ahmed Elsayed
Ahmed Elsayed 2013 年 11 月 22 日
回答済み: Walter Roberson 2013 年 11 月 22 日
Hello, I have a MAT file, this file contains 600 structures, their names start from (island001) to (island 600) and each structure contains 12 variables. I want to build 12 vectors, vector for each variable in all the structures.I was thinking to create a for loop to pass over the structures but I couldn't index the structure name. Please help me to build a vector out of this structures.

採用された回答

Walter Roberson
Walter Roberson 2013 年 11 月 22 日
If you load the .mat file using the function form of load,
ABC = load('TheFile.mat');
then the variable you name will become a structure with one field for each variable. This reduces the problem from needing to index through variables to needing to instead index through field names. Which is safer. The technique is shown in the link above.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMatrix Indexing についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by