Problem 512. Spot the rectangle
Solution Stats
Problem Comments
-
3 Comments
test cases imply that the question title should be "spot the square"
I added a rectangular (non-square) test case. Thanks for the note.
Could you add
a = ones(3) - eye(3)
to the test suite?
Solution Comments
-
3 Comments
This solution's actually not correct, since it incorrectly detects a rectangle in
a = ones(3) - eye(3)
Test case has been added, and your solution has been rescored.
Thank you!
-
2 Comments
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/
Problem Recent Solvers99
Suggested Problems
-
6535 Solvers
-
Return the largest number that is adjacent to a zero
4703 Solvers
-
Check to see if a Sudoku Puzzle is Solved
307 Solvers
-
431 Solvers
-
756 Solvers
More from this Author50
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!