主题:程序报错,请指教
我编了段程序,运行总是报错,没有找到原因。希望各位高人指点下。
报错信息为:Error using ==> map\private\parseDistAzInputs
Not enough input arguments.
Error in ==> distance at 75
[useGeodesic, lat1, lon1, lat2, lon2, ellipsoid, ...
Error in ==> sjcs at 231
S(c1).E=S(c1).E- ( (ETX+EDA)*(400) + Efs*400*( distance * distance ))*0.5;
部分报错程序如下:
S(i).distance=sqrt( (S(i).xd-(S(n+1).xd) )^2 + (S(i).yd-(S(n+1).yd) )^2 );
for i=1:1:n
if(S(i).E>0)
if(S(i).ETi==1)
for x=1:1:n
for y=1:1:n
if(S(x).distance>S(y).distance)
c1=y;
else
c1=x;
end
end
end
end
if(S(i).ETi==2)
for x=1:1:n
for y=1:1:n
if(S(x).distance>S(y).distance)
c2=y;
else
c2=x;
end
end
end
end
if(S(i).ETi==3)
for x=1:1:n
for y=1:1:n
if(S(x).distance>S(y).distance)
c3=y;
else
c3=x;
end
end
end
end
if(S(i).ETi==4)
for x=1:1:n
for y=1:1:n
if(S(x).distance>S(y).distance)
c4=y;
else
c4=x;
end
end
end
end
if (S(c1).distance>do)
S(c1).E=S(c1).E- ( (ETX+EDA)*(400) + Emp*400*( distance*distance*distance*distance ))*0.5;
else
S(c1).E=S(c1).E- ( (ETX+EDA)*(400) + Efs*400*( distance * distance ))*0.5;
end
if (S(c2).distance>do)
S(c2).E=S(c2).E- ( (ETX+EDA)*(400) + Emp*400*( distance*distance*distance*distance ))*0.5;
else
S(c2).E=S(c2).E- ( (ETX+EDA)*(400) + Efs*400*( distance * distance ))*0.5;
end
if (S(c3).distance>do)
S(c3).E=S(c3).E- ( (ETX+EDA)*(400) + Emp*400*( distance*distance*distance*distance ))*0.5;
else
S(c3).E=S(c3).E- ( (ETX+EDA)*(400) + Efs*400*( distance * distance ))*0.5;
end
if (S(c4).distance>do)
S(c4).E=S(c4).E- ( (ETX+EDA)*(400) + Emp*400*( distance*distance*distance*distance ))*0.5;
else
S(c4).E=S(c4).E- ( (ETX+EDA)*(400) + Efs*400*( distance * distance ))*0.5;
end
end
end
程序中出现的变量均已经定义过
谢谢各位了
报错信息为:Error using ==> map\private\parseDistAzInputs
Not enough input arguments.
Error in ==> distance at 75
[useGeodesic, lat1, lon1, lat2, lon2, ellipsoid, ...
Error in ==> sjcs at 231
S(c1).E=S(c1).E- ( (ETX+EDA)*(400) + Efs*400*( distance * distance ))*0.5;
部分报错程序如下:
S(i).distance=sqrt( (S(i).xd-(S(n+1).xd) )^2 + (S(i).yd-(S(n+1).yd) )^2 );
for i=1:1:n
if(S(i).E>0)
if(S(i).ETi==1)
for x=1:1:n
for y=1:1:n
if(S(x).distance>S(y).distance)
c1=y;
else
c1=x;
end
end
end
end
if(S(i).ETi==2)
for x=1:1:n
for y=1:1:n
if(S(x).distance>S(y).distance)
c2=y;
else
c2=x;
end
end
end
end
if(S(i).ETi==3)
for x=1:1:n
for y=1:1:n
if(S(x).distance>S(y).distance)
c3=y;
else
c3=x;
end
end
end
end
if(S(i).ETi==4)
for x=1:1:n
for y=1:1:n
if(S(x).distance>S(y).distance)
c4=y;
else
c4=x;
end
end
end
end
if (S(c1).distance>do)
S(c1).E=S(c1).E- ( (ETX+EDA)*(400) + Emp*400*( distance*distance*distance*distance ))*0.5;
else
S(c1).E=S(c1).E- ( (ETX+EDA)*(400) + Efs*400*( distance * distance ))*0.5;
end
if (S(c2).distance>do)
S(c2).E=S(c2).E- ( (ETX+EDA)*(400) + Emp*400*( distance*distance*distance*distance ))*0.5;
else
S(c2).E=S(c2).E- ( (ETX+EDA)*(400) + Efs*400*( distance * distance ))*0.5;
end
if (S(c3).distance>do)
S(c3).E=S(c3).E- ( (ETX+EDA)*(400) + Emp*400*( distance*distance*distance*distance ))*0.5;
else
S(c3).E=S(c3).E- ( (ETX+EDA)*(400) + Efs*400*( distance * distance ))*0.5;
end
if (S(c4).distance>do)
S(c4).E=S(c4).E- ( (ETX+EDA)*(400) + Emp*400*( distance*distance*distance*distance ))*0.5;
else
S(c4).E=S(c4).E- ( (ETX+EDA)*(400) + Efs*400*( distance * distance ))*0.5;
end
end
end
程序中出现的变量均已经定义过
谢谢各位了