|
楼主 |
发表于 2009-3-21 19:11
|
显示全部楼层
这是我用MATLAB编的程序所画出的图像,我现在是要求给定始末点x值相同。求其曲线间平均厚度。这应该用什么函数编啊。有高手给我编一个程序来求其平均厚度。两条曲线的函数是
axis([0 10 0 10]); hold on
xy = []; n = 0;
disp('Left mouse button picks points.'); disp('Right mouse button picks last point.');
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,:),'b-');
xy = []; n = 0;
disp('Left mouse button picks points.'); disp('Right mouse button picks last point.');
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,:),'b-');
hold off
grid on
[ 本帖最后由 ChaChing 于 2009-3-21 21:33 编辑 ] |
|