How can I find a row in a matrix in which all elements apply to a relational operator?
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Maar1997
el 19 de Sept. de 2019
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 comentarios
Respuesta aceptada
Más respuestas (0)
Ver también
Categorías
Más información sobre Matrix Indexing en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!