Borrar filtros
Borrar filtros

find the desired data

1 visualización (últimos 30 días)
Kugen Raj
Kugen Raj el 8 de Mzo. de 2012
i have sample data in which i want to look for a desired value. Columns 260 through 266
-12.0381 -9.8567 -7.9494 -6.2871 -4.8478 -3.6150 -2.5755
Columns 267 through 273
-1.7197 -1.0401 -0.5313 -0.1895 -0.0127 0 -0.1522
Columns 274 through 280
-0.4713 -0.9611 -1.6269 -2.4760 -3.5183 -4.7665 -6.2372
above is part of the data that i calculated. I need to find the location of values(-3.6150). Im calculating this value for 100 times. So, i have to find -3 value in each loop.

Respuestas (1)

Sean de Wolski
Sean de Wolski el 8 de Mzo. de 2012
Something like:
idx = find(abs(x - (-3.6150))<10^-10)
  3 comentarios
Oleg Komarov
Oleg Komarov el 18 de Mzo. de 2012
10 to the power of -10, i.e. 0.0000000001.
It's the tolerance.
Sean showed you how to carry out "floating point comparisons".
Image Analyst
Image Analyst el 18 de Mzo. de 2012
See the FAQ: http://matlab.wikia.com/wiki/FAQ#Why_is_0.3_-_0.2_-_0.1_.28or_similar.29_not_equal_to_zero.3F

Iniciar sesión para comentar.

Categorías

Más información sobre MATLAB en Help Center y File Exchange.

Etiquetas

Aún no se han introducido etiquetas.

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by