Assigning variables based on corresponding grid cells traversed by a line on a 2D grid plot
1 次查看(过去 30 天)
显示 更早的评论
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 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Annotations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!