简体   繁体   中英

Matlab connect outer boundary points in plot

Please find attached a footprint plot of a missile trajectory. I want to connect the most outer points of the plot, like this: http://nl.mathworks.com/help/matlab/ref/boundary.html . Problem is this boundary function has been implemented in matlab 2014. Unfortunatly, I have to deal with Matlab 2013a... How can I achieve the same plots as the newer boundary function? My plot-command is simply:

plot(x,y)

Thanks in advance. 在此处输入图片说明

edit: I used the convhull command. According to the description it should do the job. However, something is going wrong. the code:

figure(4)
subplot(1,2,1);
plot(y_array,x_array,'b*');
k=convhull(y_array,x_array);
subplot(1,2,2);
plot(x(k),y(k),'r-')

The same error occcures when using:

DT=delaunayTriangulation(y_array',x_array');
[K,v]=convexHull(DT);
subplot(1,2,2);
plot(x(K),y(K),'r')

在此处输入图片说明

I would try using convhull on it. From https://www.mathworks.com/help/matlab/ref/convhull.html , this is how you can plot the convex hull (if that's what you mean by 'outer points'):

xx = -1:.05:1;
yy = abs(sqrt(xx));
[x,y] = pol2cart(xx,yy);
k = convhull(x,y);
plot(x(k),y(k),'r-',x,y,'b*')

convhull was introduced before R2006a, and so should work on your version.

康维尔

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM