Labfans是一个针对大学生、工程师和科研工作者的技术社区。 | 论坛首页 | 联系我们(Contact Us) |
![]() |
![]() |
#4 |
高级会员
注册日期: 2008-05-31
年龄: 38
帖子: 104
声望力: 19 ![]() |
![]()
先用三次样条插值模拟出闭合曲线,再用matlab中计算闭合图形面积函数计算,给你程序:
clc; clear; x=[1 2 3 4 5 6 7 8]; y=[1 3 6 9 7 4 3 1]; x=[x,x(1)]; y=[y,y(1)]; plot(x,y,'r.','markersize',9); hold on; n=length(x); t=1:n; ti=linspace(1,n,100); xi=spline(t,x,ti); yi=spline(t,y,ti); plot(xi,yi,'b'); grid on; area=polyarea(xi,yi); disp(area); 结果是29.4119 我以前做过类似问题,呵呵 |
![]() |
![]() |