ignoring the negative values....

Hi to all ...........
a = rand(1,10)-0.5 cumsum(a)
the command uses all the positive and negative values generated , I want to ignore all the negative values generated once the cumsum command is executed. NOTE(negative values cannot be ignored and is being use in some other command)
Regards.....

 Respuesta aceptada

Thorsten
Thorsten el 7 de Oct. de 2015
Editada: Thorsten el 7 de Oct. de 2015
cumsum(a(a > 0))

1 comentario

Offroad Jeep
Offroad Jeep el 7 de Oct. de 2015
thanks Thorsten..... can i have your email contact please

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Preguntada:

el 7 de Oct. de 2015

Comentada:

el 7 de Oct. de 2015

Community Treasure Hunt

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

Start Hunting!

Translated by