フィルターのクリア

How to split into different tables a multi-level cell?

1 回表示 (過去 30 日間)
JoanManBar
JoanManBar 2017 年 12 月 2 日
コメント済み: JoanManBar 2017 年 12 月 6 日
My final goal is to have a 428x11 table from an image analysis that I ran which final outcome is 'data'. Object 'data' is a 428x1 cell, and that one column is a 1x11 cell that looks like ['name', v1, v2, v3, v4, v5, 6, v7, v8, V9, v10], and again, 428 times.
I have tried using data_table=regexp(data(:), '\s+', 'split'); but get an error using regexp 'All cells must be char row vectors.', and tried with 'cellstr' but didn't work. I have also tried with loops -although I am not proficient with iterations- but I can't index with multi-level cells, and something like data2=data{2:end,1}{1,1}; or data2=data{:,1}{:,1}; hasn't worked. I have seen similar questions in but MATLAB Answers haven't worked for me so far.
I really appreciate any help!

採用された回答

per isakson
per isakson 2017 年 12 月 2 日
編集済み: per isakson 2017 年 12 月 2 日
"final goal is to have a 428x11 table"
Study this
data = {
{'name1',1,2,3,4,5,6,7,8,9,0}
{'name2',1,2,3,4,5,6,7,8,9,0}
{'name3',1,2,3,4,5,6,7,8,9,0}
};
cac = cat( 1, data{:} );
mytable = cell2table( cac )
it displays in the command window
mytable =
cac1 cac2 cac3 cac4 cac5 cac6 cac7 cac8 cac9 cac10 cac11
_______ ____ ____ ____ ____ ____ ____ ____ ____ _____ _____
'name1' 1 2 3 4 5 6 7 8 9 0
'name2' 1 2 3 4 5 6 7 8 9 0
'name3' 1 2 3 4 5 6 7 8 9 0
  12 件のコメント
JoanManBar
JoanManBar 2017 年 12 月 6 日
Once again, thank you very much! I'm having some trouble with that last part since 'body' is not defined but I think it's time for me to stop bothering you and do the work myself.
I have learned more from your answers than from my experience reading the MATLAB documentation and I really appreciate that.
JoanManBar
JoanManBar 2017 年 12 月 6 日
I got it. you are brilliant, Per Isakson!

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLarge Files and Big Data についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by