Assigning variables based on corresponding grid cells traversed by a line on a 2D grid plot
10 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Hi,
Assuming I have a 3x3 grid as follows, where the blue line is connecting two points (the red crosses):

How would I code for MATLAB to return each grid cell passed through by this line i.e. to return the variables A, B, E and F?
I was thinking of coding along the lines of "if the line passes through coordinates in the x value range of ... and y value range of ... then return A" and so on for each grid cell.
If anyone could suggest how to code this considering it passes through a line simply formed by plotting two sets of coordinates, it would be much appreciated.
0 Kommentare
Antworten (0)
Siehe auch
Kategorien
Mehr zu Annotations finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!