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
There is a bug in this Problem
function b = bubbles(a)
b = ;
Passes the test.
One needs to check: b_correct ~= .
To the sort User :
[-1 0]' would come out [ -1 0] '
need to fix the test suite to include non-sorted non-zero elements
wishful thinking: perhaps sort 'should' behave like relational operators...
Distance walked 1D
So many choices
Back to basics 6 - Column Vector
Given a window, how many subsets of a vector sum positive
Rounding off numbers to n decimals
Would Homer Like It?
Convert hex color specification to MATLAB RGB
Spot the rectangle (Part 2)
Is It a Snake?
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Contact your local office