How can i find "AND" or "OR" of rows in a matrix?
Info
This question is closed. Reopen it to edit or answer.
Show older comments
Hi friends,
I'm actually working on a matrix and i need to apply "and" logic operation on the rows. For example, if we have Matrix A with 3 rows and 10 columns, i want to find the Matrix B with size 1*10 which has the result of the operation (Row1) & (Row2) & (Row3).
Answers (1)
Matt Fig
on 14 May 2011
A = round(rand(3,10))
all(A) % A(1,:) & A(2,:) & A(3,:)
any(A) % A(1,:) | A(2,:) | A(3,:)
This question is closed.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!