minor bug there. crashes for vectors and return incorrect answers for some input, for example a_in=[0 1 1 1; 0 0 0 0], a_out=[1 1 0 1; 0 0 0 0] instead of a_correct=[1 0 1 1; 0 0 0 0]. Ned, could you extend the test suite to 'kill' this answer?
Done. Thanks for the comment!
How to find the position of an element in a vector without using the find function
2482 Solvers
2268 Solvers
Multiples of a Number in a Given Range
222 Solvers
The Answer to Life, the Universe, and Everything
387 Solvers
3162 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!