love this one
28 attempts later, we finally made it
zeros are added to convert a logical to double.
The first time I see this kind of bsxfun.
Looks like I have the lamest possible solution!
I think it would be funny to see this solution in action by an animation of iterations! :-)
this breaks with nan's, solution 6118 does not
need to fix the test suite to include non-sorted non-zero elements
wishful thinking: perhaps sort 'should' behave like relational operators...
Return the 3n+1 sequence for n
6222 Solvers
Getting the row and column location from a matrix
244 Solvers
Set some matrix elements to zero
295 Solvers
210 Solvers
490 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!