|
lCoords =[70.0000,137.4797,153.0000,139.4797,231.0000,138.4797; 0,0,103.0000,139.4797,183.0000,139.4797;231.0000,138.4797,317.0000,137.4797,404.0000,137.4797]
l=size(lCoords,1)
deltaLowerCoords=zeros(l-1,1)
% 计算delta
for k=1:1:l
if (lCoords(k,1)==0&lCoords(k+1,1)==0)
deltaLowerCoords(:,=lCoords(k+1,3)-lCoords(k,3);
else if (lCoords(k,1)==0&lCoords(k+1,1)~=0)
deltaLowerCoords(:,=lCoords(k+1,1)-lCoords(k,3);
else if (lCoords(k,1)~=0&lCoords(k+1,1)==0)
deltaLowerCoords(:,= lCoords(k+1,3)-lCoords(k,3);
else deltaLowerCoords(:,=lCoords(k+1,1)-lCoords(k,1);
end
end
以上我在Matlab里运行了好几次,改了好几次,都算不出来,貌似是if之后没有跳出循环,望大家帮帮忙吧,谢谢~ |
|