test cases imply that the question title should be "spot the square"
I added a rectangular (non-square) test case. Thanks for the note.
This is a good answer. I changed the test suite so that you wouldn't have to deal with logical input matrices. Sorry about that!
This code is referenced in the following blog post: http://blogs.mathworks.com/community/2015/01/19/robot-game-playing-in-matlab-part-2/
Getting the row and column location from a matrix
236 Solvers
Generate a vector like 1,2,2,3,3,3,4,4,4,4
3630 Solvers
123 Solvers
Number of digits in an integer
336 Solvers
Area of an equilateral triangle
2764 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!