フィルターのクリア

Combine cells of a {1,3} cell array.

8 ビュー (過去 30 日間)
JE
JE 2015 年 10 月 16 日
コメント済み: JE 2015 年 10 月 16 日
I have a 1 x 3 cell array:
1x7230 double 1x7632 double 1x7566 double
{1,1}=
75 267 294 317 462 549 580 656 668
{1,2}=
131 242 300 341 451 491 575 597 724
{1,3}=
72 154 213 270 282 391 601 705 743
How do I combine these into one {1,1} cell array with the numbers in numerical order so it looks something like this: 72 75 131 154 etc...

採用された回答

Andrei Bobrov
Andrei Bobrov 2015 年 10 月 16 日
A = {[75 267 294 317 462 549 580 656 668];
[131 242 300 341 451 491 575 597 724];
[72 154 213 270 282 391 601 705 743]}
out = sort([A{:}]);

その他の回答 (1 件)

Guillaume
Guillaume 2015 年 10 月 16 日
編集済み: Guillaume 2015 年 10 月 16 日
v = sort([yourcellarray{:}])
Note that I've not put the result into a single cell cell array because there's not much point.
if you really want to:
c = {sort([yourcellarray{:})]}
  2 件のコメント
JE
JE 2015 年 10 月 16 日
74 89 101 279 399 461 711 797 846
I end up with this, which doesn't make sense because after 74, most of these numbers cannot be found in my original array.
JE
JE 2015 年 10 月 16 日
My bad, wrong variable.

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

カテゴリ

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