I need to connect nodes from startNode to endNode

4 次查看(过去 30 天)
I have an array from nodes that is basically the pathway that I want to plot a line through.
Here is the array
nodes = [250 250 249 248 247 246 221 220 219...
218 193 192 167 142 141 140 139 138...
137 136 135 134 133 132 107 82 81...
80 105 104 103 102 77 52 51 26 1]
The order of the nodes is from left to right, from bottom up.
  1 个评论
Walter Roberson
Walter Roberson 2020-5-3
Those look like they might be linear indices? But if they are... then 250 is not at an edge. The numbers you give appear to be more consistent with a 10 x 25 field than with a 15 x 25 field.
You should be able to ind2sub() and use the first output as the Y coordinate and the second output as the X coordinate.

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Descriptive Statistics and Visualization 的更多信息

产品


版本

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by