Turning each element of a double array into an element of a cell

1 回表示 (過去 30 日間)
MiauMiau
MiauMiau 2017 年 1 月 23 日
コメント済み: Star Strider 2017 年 1 月 23 日
Hi
I know the mat2cell function, but as far as I see it is more suited to turn mats into cells when you have a cell with only a few elements. However, I have an array of size 1x1000, and have to turn each of the columns into an element of a cell (hence the cell would also have the dimensions 1x1000). How can I do that fast/automatically? Many thanks

採用された回答

Star Strider
Star Strider 2017 年 1 月 23 日
I would use the num2cell function:
A = [1 2 3]
B = num2cell(A)
A =
1 2 3
B =
1×3 cell array
[1] [2] [3]
  2 件のコメント
MiauMiau
MiauMiau 2017 年 1 月 23 日
omg..thanks so much!
Star Strider
Star Strider 2017 年 1 月 23 日
As always, my pleasure!

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

その他の回答 (0 件)

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by