ignoring the negative values....

28 views (last 30 days)
Offroad Jeep
Offroad Jeep on 7 Oct 2015
Commented: Offroad Jeep on 7 Oct 2015
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.....

Accepted Answer

Thorsten
Thorsten on 7 Oct 2015
Edited: Thorsten on 7 Oct 2015
cumsum(a(a > 0))
  1 Comment
Offroad Jeep
Offroad Jeep on 7 Oct 2015
thanks Thorsten..... can i have your email contact please

Sign in to comment.

More Answers (0)

Categories

Find more on Random Number Generation in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!