2
我想選擇使用多邊形形狀的數據。我知道roipoly是爲'圖像'做的。是否有這樣的散點圖?matlab - 我可以使用roipoly從散點圖中獲取數據嗎?
我想選擇使用多邊形形狀的數據。我知道roipoly是爲'圖像'做的。是否有這樣的散點圖?matlab - 我可以使用roipoly從散點圖中獲取數據嗎?
您可以使用數據刷新來標記散點圖上的數據,然後將其提取到工作區。在數字窗口頂部尋找小刷子符號。
查看Marking up graphs with Data Brushing來自Matlab,和Accessing plot brushed data來自非常有用的Undocumented Matlab。
如果你想畫一個複雜的多邊形,你可以impoly和inpoly使用:
X = rand(200, 2);
scatter(X(:,1), X(:,2));
h = impoly();
% now you go and position the polygon, control returns once you've 'finsished' with it '
nodes = getPosition(h);
selected_indices = inpoly(X, nodes);
哇! 'inpoly'很棒。 (必須從http://www.mathworks.com/matlabcentral/fileexchange/10391-fast-points-in-polygon-test下載) – codekitty 2012-04-09 15:01:33
你也可以使用現有的matlab函數「inpolygon」 – fstevens 2013-10-19 12:43:05
感謝鏈接到matlabcentral ;在使用google搜索時,我已經結束了一個不同的具有相同名稱的Matlab函數(這不適用於上面的例子) – tsttst 2017-10-25 15:29:18