Borrar filtros
Borrar filtros

how to extract just a value lower than 1

5 visualizaciones (últimos 30 días)
Pichawut Manopkawee
Pichawut Manopkawee el 8 de Nov. de 2016
Comentada: Pichawut Manopkawee el 8 de Nov. de 2016
Hi all,
I have a .mat file containing a varied number from less than 0 to much more than 0. I would like to extract or just concentrate on value just below 0, I will give them as 1. Also, the numbers which are greater than 1, I would give them as 0.
I know if statement is useful for this, but I don't know how to do that. Anyway, is there any function like x(isnan(x))=0 that change the conditional number below 0 to be 1?
Thanks in advance, Pich

Respuesta aceptada

Walter Roberson
Walter Roberson el 8 de Nov. de 2016
x(x < 0) = 1;
x(x > 1) = 0;
  1 comentario
Pichawut Manopkawee
Pichawut Manopkawee el 8 de Nov. de 2016
Thanks Walter,
I just know that there is an easy way to cope with this. Thanks again.
Pich

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Data Import and Analysis 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