フィルターのクリア

For calculating area

1 回表示 (過去 30 日間)
Jaejin Hwang
Jaejin Hwang 2012 年 1 月 6 日
I used the spine function to make the region. Is there way I can calculate the area of this region?
Here is my code.
figure, imshow('ac21sag.png')
hold on
xy = [];
n = 0;
but = 1;
while but == 1
[xi,yi,but] = ginput(1);
plot(xi,yi,'ro')
n = n+1;
xy(:,n) = [xi;yi];
end
t = 1:n;
ts = 1: 0.1: n;
xys = spline(t,xy,ts);
plot(xys(1,:),xys(2,:),'r-');
hold off

回答 (1 件)

Jonathan Sullivan
Jonathan Sullivan 2012 年 1 月 6 日
polyarea
A = polyarea(xys(1,:),xys(2,:));

カテゴリ

Help Center および File ExchangeSplines についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by