Info

この質問は閉じられています。 編集または回答するには再度開いてください。

How can I calculate the area between two wawe lines of two agents?

1 回表示 (過去 30 日間)
alireza shirazi
alireza shirazi 2019 年 1 月 15 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
Hi, I have two set of points from a big matrix which I want to calculate the area between 2 line and then fill them. M and N are x / y positions of beetle and Ant in a forest. Previous answers in mathwork didnt work for me. Thanks a lot.
x1=M(M(:,3)==1 & M(:,1)==1 & M(:,4),5);
y1=M(M(:,3)==1 & M(:,1)==1 & M(:,4),6);
plot (x1,y1)
hold on
x2=N(N(:,3)==1 & N(:,1)==2 & N(:,4),5);
y2=N(N(:,3)==1 & N(:,1)==2 & N(:,4),6);
plot (x2,y2)
hold off

回答 (1 件)

KSSV
KSSV 2019 年 1 月 15 日
Read about polyarea, trapz

Community Treasure Hunt

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

Start Hunting!

Translated by