what's wrong with 'smooth' and 'find' commands in this code?
이전 댓글 표시
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?
채택된 답변
추가 답변 (1개)
Jan
2012년 1월 31일
0 개 추천
This is one of the mayn effects of the limited precision of floating point values. See: Answers: Tag=faq6.1.
카테고리
도움말 센터 및 File Exchange에서 Stair Plots에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!