• 大小: 24KB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2021-06-02
  • 语言: Matlab
  • 标签: matlab  

资源简介

三边测量定位仿真程序,适用于课程设计仿真,源代码可运行

资源截图

代码片段和文件信息

%%%%%%%%%%%%%%%%%%%%%%find the i_st unknown points location error%%%%%%%
function locerror=finderror(distancechoicepointsnunknownunknownpointskr);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
re_n=3;
NodeE=zeros(re_n2);

cpointsnum=size(choicepoints1);
%%%%%%%%%get k vertexs%%%%%%%%% 
gettrinodes=combntns([1:cpointsnum]3);
nget=size(gettrinodes1);

xls=zeros(2nget);
%%%%%%%%%%%%%%%estimate location%%%%%%%%%%%%%
for i=1:nget
    for j=1:re_n
        NodeE(j:)=choicepoints(gettrinodes(ij):);
        distanceTri(j)=distance(gettrinodes(ij));
%         distancesquare(j)=distanceTri(j)*distanceTri(j);
        
        Rsquare(j)=(norm(NodeE(j:)))^2;
        
        noise=kr*distanceTri(j);
        distanceN(j)=distanceTri(j)+noise;
        distanceNsquare(j)=distanceN(j)*distanceN(j);
    end
  
    A=NodeE(1:2:);
    B=ones(21)*NodeE(3:);
    M=2*(B-A);
    
    P=(distanceNsquare(:1:2))‘;
    Q=ones(21)* distanceNsquare(3);
    W=(Rsquare(:1:2))‘;
    V=ones(21)*Rsquare(3);
    L=P-Q+V-W;
    
    xls(:i)=inv(M‘*M)*M‘*L;
    
    %%%%%%%%%compute normalized weight%%%%%%%%
    da=norm(NodeE(3:)-NodeE(2:));
    db=norm(NodeE(3:)-NodeE(1:));
    dc=norm(NodeE(2:)-NodeE(1:));
    
    cos_Ad=(db^2+dc^2-da^2)/(2*db*dc);
    cos_Bd=(dc^2+da^2-db^2)/(2*dc*da);
    cos_Cd=(da^2+db^2-dc^2)/(2*da*db);
    
    Ad=acos(cos_Ad);
    Bd=acos(cos_Bd);
    Cd=acos(cos_Cd);
    
    m_agnle=min([Ad Bd Cd]);%%%%%%%%%%computing minimum angle
    
    %%%%%%%%%%%%allocating weight%%%%%%%%%%%%
    if (m_agnle<=(45/180)*pi)&&(m_agnle>=(20/180)*pi)
        w(i)=tan(m_agnle);
    elseif (m_agnle>(45/180)*pi)&&(m_agnle<=(55/180)*pi)
        w(i)=cot(m_agnle);
    else
        w(i)=0;
    end
    
end

   xls=xls‘;
   
     w_sum=sum(w);
     ix=0;
     iy=0;
    if w_sum==0;
        ix=sum(xls(:1))/nget;
        iy=sum(xls(:2))/nget;
    else
        for i=1:nget
            w(i)=w(i)/w_sum;
            ix=ix+w(i)*xls(i1);
            iy=iy+w(i)*xls(i2);
        end
     end
     
      locnode(11)=ix;
      locnode(12)=iy;
      
      locerror=norm(locnode-unknownpoints(nunknown:));
      
      
      







 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2018-09-04 15:24  三边测量定位MATLAB源码\
     文件          55  2018-08-27 11:33  三边测量定位MATLAB源码\【源码使用必读】.url
     目录           0  2018-09-04 15:23  三边测量定位MATLAB源码\三边测量定位\
     目录           0  2018-09-04 15:23  三边测量定位MATLAB源码\三边测量定位\tri_arc_location\
     文件        2191  2011-06-02 17:40  三边测量定位MATLAB源码\三边测量定位\tri_arc_location\finderror.asv
     文件        2279  2011-06-02 17:44  三边测量定位MATLAB源码\三边测量定位\tri_arc_location\finderror.m
     文件        2279  2011-06-03 17:19  三边测量定位MATLAB源码\三边测量定位\tri_arc_location\finderror2.m
     文件        1250  2011-06-03 14:54  三边测量定位MATLAB源码\三边测量定位\tri_arc_location\loc_mian.asv
     文件        1259  2011-06-03 17:19  三边测量定位MATLAB源码\三边测量定位\tri_arc_location\loc_mian.m
     文件          82  2011-06-03 15:52  三边测量定位MATLAB源码\三边测量定位\tri_arc_location\Read me.txt
     文件         704  2011-06-02 15:20  三边测量定位MATLAB源码\三边测量定位\tri_arc_location\selectchoicepoints.asv
     文件        1085  2011-06-03 15:19  三边测量定位MATLAB源码\三边测量定位\tri_arc_location\selectchoicepoints.m
     文件         212  2011-06-02 10:30  三边测量定位MATLAB源码\三边测量定位\tri_arc_location\unif_points.asv
     文件         330  2011-06-02 10:54  三边测量定位MATLAB源码\三边测量定位\tri_arc_location\unif_points.m
     文件        3045  2011-06-02 11:06  三边测量定位MATLAB源码\三边测量定位\tri_arc_location\vertexlocation.m
     目录           0  2018-09-04 15:23  三边测量定位MATLAB源码\三边测量定位\tri_arc_location2\
     文件        2191  2011-06-02 17:40  三边测量定位MATLAB源码\三边测量定位\tri_arc_location2\finderror.asv
     文件        2347  2011-06-03 17:18  三边测量定位MATLAB源码\三边测量定位\tri_arc_location2\finderror1.m
     文件         411  2011-06-03 16:37  三边测量定位MATLAB源码\三边测量定位\tri_arc_location2\getdist.asv
     文件        1250  2011-06-03 14:54  三边测量定位MATLAB源码\三边测量定位\tri_arc_location2\loc_mian.asv
     文件        1258  2011-06-03 17:17  三边测量定位MATLAB源码\三边测量定位\tri_arc_location2\loc_mian.m
     文件          82  2011-06-03 16:05  三边测量定位MATLAB源码\三边测量定位\tri_arc_location2\read me.txt
     文件         704  2011-06-02 15:20  三边测量定位MATLAB源码\三边测量定位\tri_arc_location2\selectchoicepoints.asv
     文件        1158  2011-06-03 15:58  三边测量定位MATLAB源码\三边测量定位\tri_arc_location2\selectchoicepoints.m
     文件         212  2011-06-02 10:30  三边测量定位MATLAB源码\三边测量定位\tri_arc_location2\unif_points.asv
     目录           0  2018-09-04 15:23  三边测量定位MATLAB源码\三边测量定位\tri_arc_location3\
     文件        2191  2011-06-02 17:40  三边测量定位MATLAB源码\三边测量定位\tri_arc_location3\finderror.asv
     文件        2347  2011-06-03 17:18  三边测量定位MATLAB源码\三边测量定位\tri_arc_location3\finderror1.m
     文件        2279  2011-06-03 17:16  三边测量定位MATLAB源码\三边测量定位\tri_arc_location3\finderror2.m
     文件        1200  2011-06-03 17:08  三边测量定位MATLAB源码\三边测量定位\tri_arc_location3\loc_mian.asv
     文件        1715  2011-06-03 17:29  三边测量定位MATLAB源码\三边测量定位\tri_arc_location3\loc_mian.m
............此处省略8个文件信息

评论

共有 条评论