ignoring the negative values....

8 次查看(过去 30 天)
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.....

采纳的回答

Thorsten
Thorsten 2015-10-7
编辑:Thorsten 2015-10-7
cumsum(a(a > 0))

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Annotations 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by