This function takes a set of vertices defined by the vectors X and Y and returns true if they form a rectangle and false otherwise.
X and Y do not need to be sorted, but it is assumed that X(i) is paired with Y(i).
You can also call the function with one input Z, such that Z = [X(:),Y(:)].
For examples, check out the test suite for the following Cody problem:
http://www.mathworks.com/matlabcentral/cody/problems/2671-check-if-vertices-form-a-rectangle
Cite As
Matthew Eicholtz (2026). isrectangle (https://uk.mathworks.com/matlabcentral/fileexchange/48454-isrectangle), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Created with
R2014a
Compatible with any release
Platform Compatibility
Windows macOS LinuxCategories
Find more on Test Scripts in Help Center and MATLAB Answers
Tags
Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.
| Version | Published | Release Notes | |
|---|---|---|---|
| 1.0.0.0 |
