Problem 45695. How many points lie within the rectangle and how many aren't?
Suppose, you are given the coordinates of bottom-left and top-right corners of a rectangle as input-1, R i.e R=[Bottom-left corner co-ordinate; Top-Right corner coordinate]. And you are told to count the points of the input-2, P (which represents multiple points a,b,c,d, etc within a matrix i.e P=[a;b;c;d]) lie within the rectangle, R and how many are not. Show them collectively within an output matrix, Y.
Example: Inputs: R=[0 0;10 8], P=[1 5;-1 5] Output: Y=[1 1];
Solution Stats
Problem Comments
Solution Comments
Show commentsProblem Recent Solvers26
Suggested Problems
-
Return the 3n+1 sequence for n
8227 Solvers
-
Determine if a Given Number is a Triangle Number
370 Solvers
-
Back to basics 19 - character types
261 Solvers
-
Matlab Basics - Set unwanted parts of a vector to zero
242 Solvers
-
Height of a right-angled triangle
1753 Solvers
More from this Author5
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!