how can i find a special row
Show older comments
How can i find a row which including only -1. In that A matrix how can i write a code
A=[-1,-1,0,0,0;0,0,0,-1,0;0,1,-1,0,-1;0,0,1,0,0;1,0,0,1,1]
Accepted Answer
More Answers (1)
Roger Stafford
on 6 Jun 2013
I am guessing that you mean, how can you find those rows each of which includes at least one -1. Is that what you mean? If so, do this:
f = find(any(A==-1,2));
Categories
Find more on Linear Algebra in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!