Problem 147. Too mean-spirited
I added another test to the suite that invalidated this cheesy solution.
Why is eval forbidden while regexp isn't? Don't they have the same 'nature'?
It seems that the vast majority of leading solutions are size 10 or 11. If a problem has a single output, then having a return argument of 'ans' makes the size smaller. For instance:
is smaller in size than
m = mean([x y])
This seems silly, and makes me think that there is some 'trick' to these size 10&11 solutions that has little to do with good coding practices. Of course, it could just be sour grapes on my part because I can't get my sizes even close to that small.
Problem Recent Solvers1856
Convert a vector into a number
Try 1.5.4: Celsius to Fahrenheit
More from this Author23
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!