why do I get this error while using find to determine the element in my list?

조회 수: 4 (최근 30일)
Hello dear friends.
I am encountring an error wile using the find command. could you please help.
kff is vector and my k flutter is equal to 0.3000.
when i enter 0.3000 directly to my find command it works but when i enter k_flutter it is not working.
thanks.

채택된 답변

KSSV
KSSV 2022년 1월 17일
You should not comapre floating point numbers like that.
Try:
tol = 10^-5 ; % try changing the tolerance
find(abs(kff-k_flutter)<tol)
  댓글 수: 3

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by