for example I have a matrix
A=1 2
3 0
0 0
4 5
0 6
I need to filter out only those rows having no zeros(in this case [4 5]). thank you for your help.........

2 件のコメント

Image Analyst
Image Analyst 2013 年 3 月 11 日
Why does row 1, with [1,2] in it, get to remain?
suresh G
suresh G 2013 年 3 月 11 日
oh sorry.......that was a mistake by me.... also i need to filter out those rows with atleast one zero, so that my result should be A=[1 2; 4 5]

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

 採用された回答

Walter Roberson
Walter Roberson 2013 年 3 月 11 日

1 投票

A( all(A,2), : ) = [];
If "filter out" means to remove.

3 件のコメント

suresh G
suresh G 2013 年 3 月 11 日
thank you Mr.Walter. there was a mistake in my question.I need to filter out those rows with atleast one zero. how can I do it?
Walter Roberson
Walter Roberson 2013 年 3 月 11 日
A( ~all(A,2), : ) = [];
suresh G
suresh G 2013 年 3 月 11 日
thnx a lot.....

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

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File Exchange で Behavior and Psychophysics についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by