data = importdata('C:\Users\Lenovo\Desktop\rpts_new.txt') //文件位置和名称
x = data(:,1) //x等于第一列数据
y = data(:,2) //y等于第二列数据
x = x' //列向量转成行向量,为拟合曲线做准备
y = y' //同上
//=============================
/*转化成直角坐标*/
x1 = x;
y1 = y;
for i = 1:2556
x1(1,i) = (6371000*pi/180)*(y(1,i)-y(1,1))*cos(pi*x(1,i)/180);
y1(1,i) = 6371000*pi/180*(x(1,i)-x(1,1));
end
plot(x1(1,:),y1(1,:),'.')
figure(2)
plot(x(1,:),y(1,:),'*')