This solution is outdated. To rescore this solution, sign in.
-
1 Comment
Matt
on 30 Jan 2014
Compared this solution score to sum(1:n). Using tic toc and varying sizes of n repeated up to 1,000,000 times I found that n*(n+1)/2 is by far faster. On the order of 10,000 times faster.
Suggested Problems
-
Remove the polynomials that have positive real elements of their roots.
1707 Solvers
-
6681 Solvers
-
Given an unsigned integer x, find the largest y by rearranging the bits in x
1870 Solvers
-
1102 Solvers
-
5548 Solvers
More from this Author96
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!