Very interesting topic... glad be part of this multi-output discussion.
Wow...never thought this one also do the trick. Awesome!
Why does str2num work for anonymous function?
Don't be confused by the name "str2num", which might give you a wrong impression that this function only works for str to number conversion. In fact, it is more powerful because it supports evaluation of any valid string or character represented MATLAB expressions in much the same way eval does. The underlying implementation of str2num is indeed based on eval. Check the documentation and source file for more details.
Cheating a bit. I believe test suite need some "try...catch" to prevent such behaviour.
nevertheless, didn't see this coming. never expected that kinda structure would work.
@Jan Orwat, Nice! Everything is changes from star to star.
Find all elements less than 0 or greater than 10 and replace them with NaN
13145 Solvers
1432 Solvers
Generate N equally spaced intervals between -L and L
573 Solvers
27 Solvers
Remove entire row and column in the matrix containing the input values
171 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!