Remove entire row if sum is lesser than parameter

2 ビュー (過去 30 日間)
Eduardo
Eduardo 2014 年 1 月 14 日
回答済み: Anand 2014 年 1 月 14 日
So, I have this cell array of numbers, and I want to delete a entire row if the sum of its values are lesser than a predetermined number. I tried using for loop and while loop but it's too slow due to the size of my cell array. Is there any way of doing this using cell fun?
example: cell1 =
[1] [2] [3]
[0] [0] [0]
[4] [5] [6]
then I want only rows where the sum is greater than 10.
cell1 =
[4] [5] [6]
Thanks.

採用された回答

Anand
Anand 2014 年 1 月 14 日
Try this:
>> cell1(find(sum(cell2mat(cell1),2)>10),:)

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMatrix Indexing についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by