Combine the rows of an mxn cell array into a single mx1 cell array.

3 ビュー (過去 30 日間)
TastyPastry
TastyPastry 2015 年 9 月 29 日
回答済み: Stephen23 2015 年 9 月 29 日
I have a cell array of a known number of columns but a variable number of rows.
For example, I might have a 2x3 cell: A = {'hi',1,2;'bye',3,'bob'}.
I'm trying to output a 2x1 cell: B = {{'hi',1 2};{'bye',3,'bob'}}.
I tried using cat(), to no avail. Any suggestions?

採用された回答

Stephen23
Stephen23 2015 年 9 月 29 日
num2cell(A,2)

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCreating and Concatenating Matrices についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by