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
-
4766 Solvers
-
How to find the position of an element in a vector without using the find function
2615 Solvers
-
Back to basics 6 - Column Vector
1013 Solvers
-
421 Solvers
-
552 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!