find and ismember are not working for one number in a vector
Mostrar comentarios más antiguos
Hey, I am new here and I searched a couple of time for my subject but I could not find anything. My question: I have a vector x=0.4:0.02:0.6; When I try to use "find" [find(x==0.42) --> empty matrix] or "ismember" [ismember(0.42,x) --> 0] to find the indexes of the numbers it is working for all number except the number 0.42. Can somebody tell me how that is possible and how I can solve this issue? Kind regards
Ralf
Respuesta aceptada
Más respuestas (1)
Ralf Sch
el 3 de Mayo de 2013
0 votos
2 comentarios
Iman Ansari
el 3 de Mayo de 2013
x=0.4:0.02:0.6;
find(abs(x-.42)<0.001)
Ralf Sch
el 3 de Mayo de 2013
Categorías
Más información sobre Matrix Indexing 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!