Hello everyone. Now I come across such a problem: given the coordinates of all points of the closed curve acbd, now I want to find all points of the curve ACB and save them. The code I write is as follows, but there are always mistakes. I

Where M0 is the set of all points.
CODE:
dc=centroids(:,2);
idx2=MO(:,1)>=-50;
idx3=MO(:,1)<=100;
idx4=MO(:,2)>=dc;
dataC=MO(idx2,:);
dataD=MO(idx3,:);
dataE=MO(idx4,:);
dataF=intersect(dataC,dataD,'rows');%Finding the intersection of dataF,
dataG=intersect(dataF,dataE,'rows');%Finding the intersection of dataG

7 件のコメント

Wesley
Wesley 2021 年 5 月 31 日
The concrete expression is that dataE and dataG are empty sets.
Wesley
Wesley 2021 年 5 月 31 日
Or I think another way is to determine all the points of the curve ACB by the two lines larger than AB and AD.
Wesley
Wesley 2021 年 5 月 31 日
erro:The index at position 2 is outside the array boundary (cannot exceed 1).
KSSV
KSSV 2021 年 5 月 31 日
What error you get? In the mat file, centroids is not defined and MO is not defined. Show us the complete code which lead to your error along with the error.
Wesley
Wesley 2021 年 5 月 31 日
dataE=MO(idx4,:);There is something wrong with this code. I don't know how to correct it.
Wesley
Wesley 2021 年 5 月 31 日
idx3=MO(:,1)<=x;
idx4=MO(:,2)>=y;
Can we intercept data together?
Wesley
Wesley 2021 年 5 月 31 日
Or can ACB data be cut out by straight line AD and BD?

サインインしてコメントする。

回答 (1 件)

Here is your data looks like
s = load('M0.mat');
[x,y] = deal(s.M(:,1),s.M(:,2));
plot(x,y)

カテゴリ

ヘルプ センター および File Exchange で Get Started with MATLAB についてさらに検索

質問済み:

2021 年 5 月 31 日

回答済み:

2021 年 6 月 1 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by