How do I convert a 3 x3 cell to a 3 x 1 cell?

2 ビュー (過去 30 日間)
Brad
Brad 2015 年 8 月 17 日
編集済み: Azzi Abdelmalek 2015 年 8 月 17 日
I have a 3 x 3 cell matrix that looks like this;
1 1 0
1 0 1
0 0 1
I'm searching for a way (if possible) to convert this to a 3 x 1 cell that looks like this;
[1,1,0]
[1,0,1]
[0,0,1]
Does MATLAB have a built in functiont that accomplishes this?
Thank you.

採用された回答

Azzi Abdelmalek
Azzi Abdelmalek 2015 年 8 月 17 日
編集済み: Azzi Abdelmalek 2015 年 8 月 17 日
a=[1 1 0;1 0 1;0 0 1]
b=num2cell(a,2)
If a is a cell array
a={1 1 0;1 0 1;0 0 1}
b=num2cell(cell2mat(a),2)

その他の回答 (0 件)

カテゴリ

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

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by