Info

この質問は閉じられています。 編集または回答するには再度開いてください。

Convert an intricated hierarchical structure into a simple table (brain data available)

1 回表示 (過去 30 日間)
AlexDiz
AlexDiz 2021 年 11 月 15 日
閉鎖済み: AlexDiz 2021 年 11 月 16 日
Hi everyone,
so I am trying to create a table from the structure graph that can be found at the following link
once I've loaded the structure using the following code :
fid = fopen(file); % Opening the file
raw = fread(fid,inf); % Reading the contents
str = char(raw'); % Transformation
fclose(fid); % Closing the file
data = jsondecode(str); % Using the jsondecode function to parse JSON from string
I try to iterate through the structure to use at the end the function struct2table() but as it's a hierarchical structure, I fail to iterate along the structure as the name is increasing, there can be several to none structure in each "child", for example it start with "data.msg.children" (5 structures) and it continues and it can be really long... like "data.msg.children.children.children.children.children..."
it's always the same fieldname inside each structure, in fact I want to remove the hierarchical structure because this info is already in the fieldname, I just want to create a Table with these fieldnames
I hope I am clear enough
Thanks
Alex

回答 (0 件)

この質問は閉じられています。

製品


リリース

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by