Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I have 3 vectors of position data : x, y and z

x = [0.1524 0.1219 0.0610 0.0914 0.0610 0.1219 0.0305 0.0914 0.2134 0.0610 0.1219
0.0305 0.0610 0.1219 0.0914 0.1524 0.0610 0.1524 0.0610 0.0610 0.0610 0.0610
0.1524 0.0914 0.0610 0.1524 0.0610 0.2134 0.0610 0.0914 0.1524];

y = [0.1219 0.1524 0.0305 0.1219 0.1524 0.1524 0.0610 0.1219 0.1219 0.1524 0.1524
0.0610 0.0914 0.1524 0.1829 0.1829 0.0914 0.1829 0.2134 0.0914 0.2134 0.0914
0.1829 0.0610 0.0914 0.1829 0.0914 0.1829 0.2134 0.1219 0.1829];

z = [0.0305 0.0305 0.0610 0.0610 0.0610 0.0610 0.0914 0.0914 0.0914 0.0914 0.0914
0.1219 0.1219 0.1219 0.1219 0.1219 0.1524 0.1524 0.1524 0.1829 0.1829 0.2134
0.2134 0.2438 0.2438 0.2438 0.2743 0.2743 0.2743 0.3048 0.3048];

I was wondering how I could apply convex-hull on this set? Matlab doesn't accept this format but regularly spaced grid.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
175 views
Welcome To Ask or Share your Answers For Others

1 Answer

You can use convhulln to compute the convex hull for dimensions grater than 2. If you want to plot the results, use trisurf. See the sample code for your input below:

X = [x;y;z]'; %# involves a 3D point on each row  
K = convhulln(X);
trisurf(K,X(:,1),X(:,2),X(:,3))

enter image description here


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...