Simpl equestion about CUMSUM
2 views (last 30 days)
Show older comments
How can I rewrite the following code using cumsum?
A(i+1)=sum(B > i);
Kye Taylor on 14 Jun 2013
Edited: Kye Taylor on 14 Jun 2013
I don't think I would use cumsum here. Instead, try
A = sum(bsxfun(@gt,B',0:299));
Note, this command above assumes B is a row vector (the 1-by-35535 vector you mention).
More Answers (1)
Find more on 2-D and 3-D Plots 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!