フィルターのクリア

Read data from cell---str​ucture--mu​ltiple fields to table

1 回表示 (過去 30 日間)
buer
buer 2015 年 2 月 3 日
コメント済み: buer 2015 年 2 月 4 日
Hello,
Anyone gives me some basic idea. I have one cell which is 1X1000 cell, inside is 1000 1X1 struct. Inside this struct is 6 fields....My target is to get all those data with the column head fields name, then all 1000 data goes in the table. It is nested, so I need little help. Thanks .

採用された回答

Peter Perkins
Peter Perkins 2015 年 2 月 3 日
Not 100% sure of your description, but this might be what you want:
>> for i=1:3, c{i} = struct('a',i,'b',100+i); end
>> c{:}
ans =
a: 1
b: 101
ans =
a: 2
b: 102
ans =
a: 3
b: 103
>> s = [c{:}]
s =
1x3 struct array with fields:
a
b
>> t = struct2table(s)
t =
a b
_ ___
1 101
2 102
3 103
  1 件のコメント
buer
buer 2015 年 2 月 4 日
This is exactly what I want...thanks a lot...

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

その他の回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by