Strange problem with function 'find'
1 view (last 30 days)
Show older comments
Commented: Jonasz on 9 Nov 2013
Hello. I have a strange problem with function find. I have this function in for loop and I use it eg. 50 times. This function not always find what I am looking for although if I run this outside the loop it will find my value.
[M,N]=find(X==x); - problem sometimes in this place
Also I will show you the Data X file (in this place Data Y but it's the same problem - same data).
You can see that in 30 ,33 and 37 loop it didn't find the X value but this value exist and the pattern is the same as others. What it the problem?
Matt J on 9 Nov 2013
Edited: Matt J on 9 Nov 2013
Use a tolerance to allow for floating point errors,
where "somethingsmall" is small but >0
More Answers (0)
Find more on Data Type Conversion 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!