find() doesn't work until viewing variable.
Mostrar comentarios más antiguos
I'm trying to use the find function to find rows of my matrix containing 0.22, however it returns an empty matrix (even though it does contain 0.22 in multiple places).
>>find(nodes(:,2) == 0.22)
ans =
Empty matrix: 0-by-1
Strangley, if I open the matrix in the variable window, and click on the cell equal to 0.22, then click off it, then run the command again I get:
>> find(nodes(:,2) == 0.22)
ans =
11
Where 11 corresponds to the row of the cell I clicked. I'm almost certain the cell is exactly 0.22 (and it must be for the second command above to work), and I've also tried "==22*0.01" as was suggested on another answer, but this doesn't help.
Any suggestions as to why this is happening? I don't see how double clicking a value in the variable viewer could change its behavior with the find() command.
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Logical en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!