How to make NaN data

1 visualización (últimos 30 días)
hj lee
hj lee el 11 de Jun. de 2020
Comentada: hj lee el 12 de Jun. de 2020
Hello,
here is the data.
a = [-2 -1 2 3]
b = [1 2 3 4]
c=a.*b
c = [-2 -2 6 12]
right?
but I want to make the NaN value to the negative c data..
in this case, c = [NaN NaN 6 12]
How to do that?
values of b can vary depending on my initial condition, so I need the code which change to NaN automatically.

Respuesta aceptada

madhan ravi
madhan ravi el 11 de Jun. de 2020
c(c<0) = NaN
  1 comentario
hj lee
hj lee el 12 de Jun. de 2020
Thank you very much!!!

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

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

Etiquetas

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by