Reputation: 309
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)
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')
Upvotes: 1
Views: 1226
Reputation: 570
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.
Upvotes: 3