簡體   English   中英

Matlab連接圖中的外部邊界點

[英]Matlab connect outer boundary points in plot

請在附件中找到導彈軌跡的足跡圖。 我想連接該圖的最外部點,例如: http : //nl.mathworks.com/help/matlab/ref/boundary.html 問題在於此邊界函數已在matlab 2014中實現。不幸的是,我必須處理Matlab 2013a ...我如何才能獲得與較新邊界函數相同的圖? 我的繪圖命令很簡單:

plot(x,y)

提前致謝。 在此處輸入圖片說明

編輯:我使用了convhull命令。 根據描述,它應該完成這項工作。 但是,出了點問題。 編碼:

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-')

使用時發生相同的錯誤:

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

在此處輸入圖片說明

我會嘗試在其上使用convhull https://www.mathworks.com/help/matlab/ref/convhull.html中 ,這是繪制凸包的方式(如果這就是“外點”的意思):

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在R2006a之前引入,因此應該在您的版本上起作用。

康維爾

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM