Problem 57540. Repeatitive Summation
I am very confused by your explanation. b will be integers in the range [1, numel(x)], doesn't the second example violate this (where b has -2 and 0 as members)? I still don't see how you are getting your output with the explanation provided.
There was some mishap in that example, David. b was supposed to be a (and vice-versa), as you pointed out the violation.
It has been cleared out. I hope the question is clear now.
arrayfun and cellfun are loops in disguise.
Also, there seems to be some problem with the test suite, as I put in a check for cellfun and more test cases as well, but they are not showing.
I'll update the test suite again.
All array operations are loops in disguise, aren't they?
Depends on your interpretation.
Problem Recent Solvers5
The Hitchhiker's Guide to MATLAB
Project Euler: Problem 6, Natural numbers, squares and sums.
Back to basics 11 - Max Integer
Check if number exists in vector
Create incremental spiral WITHOUT USING EVAL or FEVAL
More from this Author27
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!