what's wrong with 'smooth' and 'find' commands in this code?
Ältere Kommentare anzeigen
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?
Akzeptierte Antwort
Weitere Antworten (1)
Jan
am 31 Jan. 2012
0 Stimmen
This is one of the mayn effects of the limited precision of floating point values. See: Answers: Tag=faq6.1.
1 Kommentar
Taehwan
am 31 Jan. 2012
Kategorien
Mehr zu Stair Plots finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!