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 Solvers98
Suggested Problems
-
Find the sum of all the numbers of the input vector
41409 Solvers
-
5589 Solvers
-
Determine if a Given Number is a Triangle Number
352 Solvers
-
420 Solvers
-
Find last zero for each column
384 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!