close all clear all M=dlmread(*Data1.txt*); a=M(:,1); b=M(:,2); c=M(:,3); n=length(a); for j=1:n %进入循环 x=a(j)*sin(b(j))*cos(c(j)); y=a(j)*cos(b(j))*cos(c(j)); z=a(j)*sin(c(j)); jd0=122.1; wd0=40.5; r=6356078; wd = wd0+atan(y/(z+r)); if (b(j+1)-b(j))>=0 jd=jd0+atan(x/(r*cos(wd0)+(z-ytan(wd0))*cos(wd0))); else jd=jd0-atan(x/(r*cos(wd0)+(z-ytan(wd0))*cos(wd0))); end h=sqrt(pow(a(j))+pow(r)-2*a(j)*r*cos(pi/2+c(j))); end 能帮忙看看这个程序哪里错了吗?我怎么输出的结果是文件名呢!我这刚开始用matlab拜谢楼主!