Traversing Through a Vector of Different-sized Cells
显示 更早的评论
Hi,
Let me first explain the code I want to execute. I have a matrix "V" of size (m x 2), where the first column is x values and the second column is y values. I also have a complex vector of different sized cells called "C". This vector contains indices of V, where each row can be of a different length. So, as an example:
V =
20 40
10 20
5 10
30 15
25 35
C =
1 2 3
5 2 3 1
3 4 2 1
1 5
I would like to draw a line between the coordinates in "V" corresponding to the indices in all of the rows of "C".
Therefore, the last row of "C" should look similar to this:
line([V(1,1) V(1,2)], [V(5,1) V(5,2)])
Is there a way to write some general code that fits this method?
If it helps, I am using this principle to draw Voronoi edges. "V" means the location of the vertices (coordinates) and each row in "C" corresponds to every vertex contained in each cell.
Thanks, Ian
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Logical 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!