what's wrong with 'smooth' and 'find' commands in this code?
Afficher commentaires plus anciens
x = [0 0 0 1 1 1 0 1 0 0 1 1 1 0 0 0 0];
y = smooth(x,5);
find(y(:) == 0.6)
ans = Empty matrix: 0-by-1
Running above script gives empty matrix though definitely 0.6 elements exit. What have I done wrong?
Réponse acceptée
Plus de réponses (1)
Jan
le 31 Jan 2012
0 votes
This is one of the mayn effects of the limited precision of floating point values. See: Answers: Tag=faq6.1.
1 commentaire
Taehwan
le 31 Jan 2012
Catégories
En savoir plus sur Stair Plots dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!