Grid traversal - MATLAB Cody - MATLAB Central

Problem 1963. Grid traversal

Difficulty:Rate

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

Solution Stats

33.68% Correct | 66.32% Incorrect
Last Solution submitted on Feb 22, 2024

Problem Comments

Solution Comments

Show comments
PIVlab surpasses 100K all-time File Exchange downloads
During the past twelve months, PIVlab, a MATLAB Community Toolbox for particle...
4
8
LLMs with MATLAB updated to support the latest OpenAI Models
Large Languge model with MATLAB, a free add-on that lets you access...
2
4

Problem Recent Solvers26

Suggested Problems

More from this Author12

Problem Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!