you should probably add an assert statement that checks the size of the output matrices
I second @bmtran. lu wins!
thanks, I added the extra asserts as you suggest. the other solutions submitted so far look interesting, thanks for them!
it's lu, again...
very interesting observation that lu returns binary values factors for
these inputs. i must think about this further!
Make the vector [1 2 3 4 5 6 7 8 9 10]
36348 Solvers
Find all elements less than 0 or greater than 10 and replace them with NaN
13156 Solvers
Return the 3n+1 sequence for n
6222 Solvers
800 Solvers
89 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!