答案对程序不对matlab,我的MAtlab程序哪错了~运行结果不对

function[YAW,PIT]=result_fixerror(B1,L1,H1,B2,L2,H2)  %%这是被调用函数

B1=B1*pi/180;

L1=L1*pi/180;

H1=H1;

B2=B2*pi/180;

L2=L2*pi/180;

H2=H2;

a=6378137;

e=0.006694379995;

N1=a./sqrt(1-e*sin(B1).*sin(B1));

X1=(N1+H1).*cos(B1).*cos(L1);

Y1=(N1+H1).*cos(B1).*sin(L1);

Z1=(N1.*(1-e)+H1).*sin(B1);

N2=a./sqrt(1-e*sin(B2).*sin(B2));

X2=(N2+H2)*cos(B2)*cos(L2);

Y2=(N2+H2)*cos(B2)*sin(L2);

Z2=(N2*(1-e)+H2)*sin(B2);

x =  (-sin(L2)).*(X1-X2)+(cos(L2)).*(Y1-Y2);

y =(-sin(B2).*cos(L2).*(X1-X2))+(-sin(B2).*sin(L2).*(Y1-Y2))+cos(B2).*(Z1-Z2);

z = (cos(B2).*cos(L2)).*(X1-X2)+(cos(B2).*sin(L2)).*(Y1-Y2)+sin(L2).*(Z1-Z2);

YAW=180.*atan(y./x)./pi;

PIT=180.*atan(z./sqrt(x.^2+y.^2))/pi;

——————————————————————————————————————

B1=str2double(get(handles.edit18,'string'));

L1=str2double(get(handles.edit19,'string'));

H1=str2double(get(handles.edit20,'string'));

B2=str2double(get(handles.edit6,'string'));

L2=str2double(get(handles.edit7,'string'));

H2=str2double(get(handles.edit8,'string'));

B1_value=str2double(get(handles.edit21,'string'));

L1_value=str2double(get(handles.edit22,'string'));

H1_value=str2double(get(handles.edit23,'string'));

B2_value=str2double(get(handles.edit12,'string'));

L2_value=str2double(get(handles.edit13,'string'));

H2_value=str2double(get(handles.edit14,'string'));

[YAW,PIT]=result_fixerror(B1,L1,H1,B2,L2,H2);

[YAW0,PIT0]=result_fixerror(B1+B1_value,L1+L1_value,H1+H1_value,B2+B2_value,L2+L2_value,H2+H2_value);

detayaw=abs(YAW-YAW0);

detapit=abs(PIT-PIT0);

set(handles.text47,'String',detayaw);

set(handles.text48,'String',detapit);

guidata(hObject, handles);

我反复查了N遍。。不知道哪出错了     能运行但是结果不对,望指点:handshake

[本帖最后由 mooni 于 2009-5-14 09:24 编辑]

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值