MATLAB: How to find whether any non-zero row vector or column vector is there in a matrix

finding non-zero rows or columns

i am not sure whether any function is there for finding this, basically i'm checking any row of a matrix A(m*n) is equal to the row vector R(1*n) for example, A=magic[5];A(3,:)=13; & R=[13,13,13]; i want to identify the presence of the R vector in A, i used bsx function fr this, comp=bsxfun(@eq,A,R); Res=any(comp); it got me a proper result, if comp(logical result)=[1,0,0;0,1,0;0,0,1] any function gives ans as [1,1,1] but all i need is if comp is something like this [1,0,0;0,1,0;1,1,1] then only it should give result as[1,1,1] which function should i use? basically if any full row of elements are ones.
any suggestion or helps are appreciated, thanks in advance. Durai.

Best Answer

Do:
Res = all(comp,2);
instead of
Res=any(comp);
That will tell you which rows of A are identical to R.