Hi everyone,
I have a cell data set as can be seen in the attached picture. I would like to make one big column/array with all the values from the cells.
Can anybody help?

 採用された回答

Voss
Voss 2023 年 2 月 27 日

0 投票

M = vertcat(C{:});
where C is your cell array; M will be your big column vector.

1 件のコメント

Lotte Piek
Lotte Piek 2023 年 2 月 27 日
thanks, this is even better!

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

その他の回答 (1 件)

Image Analyst
Image Analyst 2023 年 2 月 27 日

0 投票

Do you want a single very tall column vector, or a 2-D matrix with each column vector in its own column?
Did you try a simple for loop?
for k = 1 : numel(ca) % ca is your cell array
thisCellContents = ca{k};
if ~isempty(thisCellContents)
if k == 1
columnVector = thisCellContents;
else
columnVector = [columnVector; thisCellContents];
end
end
end
If you have any more questions, then attach your data and code to read it in with the paperclip icon after you read this:

1 件のコメント

Lotte Piek
Lotte Piek 2023 年 2 月 27 日
thanks, this was what I was looking for. One more question: if my cell dataset would be two cell row and I wanted two tall colums vector, how would you do that?

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

カテゴリ

ヘルプ センター および File ExchangeMatrix Indexing についてさらに検索

製品

リリース

R2022b

タグ

質問済み:

2023 年 2 月 27 日

コメント済み:

2023 年 2 月 27 日

Community Treasure Hunt

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

Start Hunting!

Translated by