How to convert a multidimensional cell into a single array of only one column.

1 回表示 (過去 30 日間)
yashvin
yashvin 2015 年 7 月 8 日
コメント済み: yashvin 2015 年 7 月 8 日
Hi I have a multidimensional cell which is:
Alt_difference_cell =
[5.2038e+03] [ 5500] [5500] [5.8133e+03] [6000]
[ 2000] [2.4830e+03] [] [] []
[ 500] [1.0004e+03] [1500] [1.9258e+03] []
[ 12.2311] [ 500] [] [] []
Some of the rows contain empty elements. I remove the empty elements by:
cell2mat(Alt_difference_cell(i,:))
where i is the number of columns.
I want to place the elements of the each rows next to each other in a single array. How to proceed?

採用された回答

Azzi Abdelmalek
Azzi Abdelmalek 2015 年 7 月 8 日
編集済み: Azzi Abdelmalek 2015 年 7 月 8 日
a={1 2 3;[] 4 5;6 [] 7}
b=a'
b=[b{:}]
or
b=cell2mat(reshape(a',1,[]))

その他の回答 (0 件)

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by