The idea is to show the usage of get and structure array. I suggest expanding the question to "Return Cody's parameter". From get(0) we see there are multiple items - Format, FormatSpacing, RecursionLimit, Language. These names could be placed in a cell array to allow random calling across four calls. This would invalidate solutions 2 and 5. Everyone will need to expand their functions to handle the string input.
I have a laptop with 2 external monitors (3 distinct display in total), but y= 1 passes the test....
You really want a larger test suite, but how would it work?
727 Solvers
Make a run-length companion vector
520 Solvers
244 Solvers
Matrix which contains the values of an other matrix A at the given locations.
214 Solvers
Sum the 'edge' values of a matrix
236 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!