Borrar filtros
Borrar filtros

How to select element of an array between two values?

46 visualizaciones (últimos 30 días)
Martha
Martha el 24 de Mzo. de 2014
Comentada: FSh el 17 de Jul. de 2021
Hi,
I have an array of 2800 elements < 2800 x 1 double >, and I want to create a new array only with the values that are greater than -0.15 and less than 0.15. Many Thanks in advance.
Regards, Martha

Respuesta aceptada

Walter Roberson
Walter Roberson el 24 de Mzo. de 2014
A(A > -0.15 & A < 0.15)
or
A(abs(A) < 0.15)
  4 comentarios
Martha
Martha el 24 de Mzo. de 2014
My apologies Walter, I tried again and it works perfectly. Thank you very much!
FSh
FSh el 17 de Jul. de 2021
strange it does not work for me ??!!!

Iniciar sesión para comentar.

Más respuestas (1)

Martha
Martha el 24 de Mzo. de 2014
Thanks Walter,
Both work very well! Do you know also how to do the same but with several columns?, That is, having < 2800 x 3 > but analyzing only values from the first column and return the values from the given rows but all the columns.
Thanks
Martha

Categorías

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

Community Treasure Hunt

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

Start Hunting!

Translated by