find() doesn't work until viewing variable.
이전 댓글 표시
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.
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Logical에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!