Hello,
I'm looking for a general way to find all possible row combinations of a matrix that add to zero.
For instance, for the matrix
A = [-1 0 0 ; 1 0 0 ; 1 -1 0 ; 0 1 -1 ; 0 1 -1; 0 0 1];
the following 6 row combinations would all sum to zero
A(1,:)+A(2,:)A(1,:)+A(3,:)+A(4,:)+A(6,:)A(1,:)+A(3,:)+A(5,:)+A(6,:)-A(2,:)+A(3,:)+A(4,:)+A(6,:)-A(2,:)+A(3,:)+A(5,:)+A(6,:)-A(4,:)+A(5,:)
Does MATLAB have any built-in functions that can help me do this? Generating all possible row combinations and testing to see which ones sum to zero seems like it would be extremely computationally intensive.
Thanks,
Kevin
Best Answer