Q:

Bitwise 'or' of all the rows of a matrix in one step

>> a = logical(randi([0 1] , 3,3))

a =

 0     1     0
 1     0     0
 0     0     0

Consieder the above example. Is there a way to take a bitwise 'or' of the whole matrix rows in one step? So I get something like: 
ans = 1 1 0 in the end 

A:

Use the any function, from the docs:

In practice, any is a natural extension of the logical OR operator.

In your case it is simply
any(a)

Like most MATLAB functions, you can choose the dimension for any to operate over using the second input so to get it operate over the columns instead of rows
any(a,2)

If you wand the equivalent for && instead of || then use all

In practice, all is a natural extension of the logical AND operator.

