manipulating three dimensional cell arrays

I have a three dimensional cell array data as follows;
val(:,:,1) =
[3x4 double]
val(:,:,2) =
[3x4 double]
val(:,:,3) =
[4x4 double]
val(:,:,4) =
[5x4 double]
val(:,:,5) =
[5x4 double]
I need to remove sub-arrays whose rows number below 4. In this case, val(:,:,1) and val(:,:,2) need to be removed. So "data" should be;
val(:,:,1) =
[4x4 double]
val(:,:,2) =
[5x4 double]
val(:,:,3) =
[5x4 double]
How can I perform this editing?

 採用された回答

Stephen23
Stephen23 2017 年 8 月 3 日
編集済み: Stephen23 2017 年 8 月 3 日

1 投票

Use cellfun and indexing. This will remove along the third dimension:
out = val(:,:,cellfun('size',val,1)>=4)

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeMatrices and Arrays についてさらに検索

質問済み:

2017 年 8 月 3 日

編集済み:

2017 年 8 月 3 日

Community Treasure Hunt

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

Start Hunting!

Translated by