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

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.

 Respuesta aceptada

You should not comapre floating point numbers like that.
Try:
tol = 10^-5 ; % try changing the tolerance
find(abs(kff-k_flutter)<tol)

3 comentarios

Mehmet Salihi commented:
thank you for your fast help.
It solved my problem. could you please explain or give me another example to undertand the core function of the tolerance while using Find command.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Loops and Conditional Statements en Centro de ayuda y File Exchange.

Preguntada:

el 17 de En. de 2022

Comentada:

el 17 de En. de 2022

Community Treasure Hunt

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

Start Hunting!

Translated by