Sparse Matrix transformation to locate columns containing zeros

Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
1 reply · 2K views
taknevski
Messages
1
Reaction score
0
Suppose I have a MxN matrix and each column may contain exactly 1 zero or
no zeros. Is there a transformation that when applied to this matrix will
return another 1xN matrix with a 0 in the corresponding column if that
column in the original matrix contains a 0 or a 1 in the column position if
that column in the original matrix contains no zeros.

For example if the 4x4 original matrix is

1 1 8 9
2 0 7 2
3 2 9 6
4 5 0 2

is there a transformation that will give me

1 0 0 1

since the 2nd and 3rd column contain a zero and the 1st and 4th columns
contain no zeros?
 
Physics news on Phys.org