How can I find a row in a matrix in which all elements apply to a relational operator?
1 view (last 30 days)
Show older comments
I have a large data set and would like to know how I could find all the rows in which each element has a certain value. The matrix could look like this:
A =
0 0 0 0 0 0 0 0
0 0 0 0.1000 0.1000 0 0 0
0 0 0.1000 0.3000 0.3000 0.1000 0 0
0.3000 0.3000 0.3000 0.3000 0.3000 0.3000 0.3000 0.3000
0.3000 0.3000 0.3000 0.1000 0.1000 0.3000 0.3000 0.3000
0 0 0.1000 0.3000 0.3000 0.1000 0 0
How could I find the fourth row if my requirement is that every element in a row should be larger than 0.25? I already looked into functions like unique, find and all, but I could not modify them in such way that it applies to a row. Preferably I would get a column containing the number of all the rows that applies to the condition. Thanks in advance!
0 Comments
Accepted Answer
More Answers (0)
See Also
Categories
Find more on Matrix Indexing 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!