Given a line defined by (x1,y1) & (x2,y2),return the number of squares that the line crosses on the grid (a square is 1x1).
Coming next: return the number of squares for any geometrical shape
Bug: The order of the arguments in the starting function definition is x1, x2, y1, y2, whereas the the order in the test cases is x1, y1, x2, y2.
Max index of 3D array
03 - Matrix Variables 6
04 - Scalar Equations 2
Dimensions of a rectangle
Compare two input matrices
How many rectangles in a grid ?
rectangle in circle
Slicing the cube
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Contact your local office