フィルターのクリア

Concatenating cells together?

2 ビュー (過去 30 日間)
Erik J
Erik J 2017 年 6 月 28 日
コメント済み: Erik J 2017 年 6 月 28 日
I have a cell array that is 54 x 5. Each cell in the array is Y x 5 - all have 5 columns but different numbers of rows.
Each cell essentially represents data for 5 variables from 54 total subjects - each row of the array is a subject and each column of the array is an experimental condition. Each individual cell is the data (5 variables) for that subject for that condition.
I would like to combine the data from each of the cells in each column of the array together, so I would end up with a 1 x 5 cell array, with each cell being Z x 5, where Z is the sum of all the rows of all the cells in any given column of the original 54 X 5 array.
Essentially, this would give me cells that have all the data for all subjects for each individual condition. Does this make sense and is this possible?
Thank you!

採用された回答

Guillaume
Guillaume 2017 年 6 月 28 日
編集済み: Guillaume 2017 年 6 月 28 日
newarray = cell(1, 5);
for col = 1:5
newarray{col} = vertcat(yourcellarray{:, col});
end
  1 件のコメント
Erik J
Erik J 2017 年 6 月 28 日
Thank you!

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

その他の回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by