MATLAB爱好者论坛-LabFans.com

MATLAB爱好者论坛-LabFans.com (https://www.labfans.com/bbs/index.php)
-   MATLAB论坛 (https://www.labfans.com/bbs/forumdisplay.php?f=6)
-   -   [MATLAB基础] 新手求助,求曲线长度的问题 (https://www.labfans.com/bbs/showthread.php?t=8926)

llj466064453 2009-06-11 15:43

新手求助,求曲线长度的问题
 
x=[0.2, 4.96, 6.55, 9.71, 13.17, 16.23, 18.36, 20.53, 23.15, 26.49, 28.23, 29.1, 30.65, 30.92, 31.67, 33.03, 34.35, 35.01, 37.5];
y=[6.66, 5.28, 4.68, 5.19, 2.34, 6.94, 5.55, 9.86, 5.28, 3.87, 3.04, 2.88, 3.68, 2.38, 2.06, 2.58, 2.16, 1.45, 6];

plot(x,y,'k.','markersize',15);
axis([-5 40 0 45]);
grid;hold on %作点

k=0.2:0.001:37.5;
u=spline (x,y,k);
plot(k,u); %三次样条插值拟合曲线

p=sqrt(diff(k).^2+diff(u).^2);
L=sum(p) %求曲线总长

%如何求每两点间的曲线长度?以数组表示出来。谢谢啊很紧急!:):)


所有时间均为北京时间。现在的时间是 06:51

Powered by vBulletin
版权所有 ©2000 - 2025,Jelsoft Enterprises Ltd.