Question about plotting a long series of lines
Show older comments
Hello, thanks for reading this,
I want to plot a series of lines, which can range from 10 or so lines to thousands.
The total network is a binary tree, but not every line bifurcates. What I do at the moment is use a for loop, and plot every line separately, but that can take a large amount of time, and it doesn't help when I need to replot the tree in repetition. I was wondering, is there an easy way to vectorize this?
My data is the following: I have a point matrix (a N by 3 matrix, where I have n points, with columns x y and z coordinates), and a face matrix (a M by 2 matrix, where I have M faces, with point indexes 1 and 2). An example can be the following:
pointMx = [0 0 0; 0 5 0; 0 10 5; 0 10 0];
faceMx = [1 4; 4 2; 4 3];
So I have a total of three lines, with one bifurcating into two segments. I can plot this by looping over the number of rows in faceMx and plotting each line individually, but that can take time. Is there a way to vectorize the plotting of these lines?
Thanks for your help!
Accepted Answer
More Answers (0)
Categories
Find more on Surface and Mesh Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!