通用水準(zhǔn)網(wǎng)形秩虧自由網(wǎng)和擬穩(wěn)平差程序設(shè)計(jì)_第1頁(yè)
通用水準(zhǔn)網(wǎng)形秩虧自由網(wǎng)和擬穩(wěn)平差程序設(shè)計(jì)_第2頁(yè)
通用水準(zhǔn)網(wǎng)形秩虧自由網(wǎng)和擬穩(wěn)平差程序設(shè)計(jì)_第3頁(yè)
通用水準(zhǔn)網(wǎng)形秩虧自由網(wǎng)和擬穩(wěn)平差程序設(shè)計(jì)_第4頁(yè)
通用水準(zhǔn)網(wǎng)形秩虧自由網(wǎng)和擬穩(wěn)平差程序設(shè)計(jì)_第5頁(yè)
已閱讀5頁(yè),還剩2頁(yè)未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡(jiǎn)介

MATLAB設(shè)計(jì)任何網(wǎng)形的秩虧自由網(wǎng)平差和擬穩(wěn)平差程序設(shè)計(jì)程序介紹:程序適合于任何網(wǎng)形的水準(zhǔn)網(wǎng)平差,原始數(shù)據(jù)輸入到連個(gè)excel表格程序界面:原始數(shù)據(jù)錄入表格:(1)DH表(2)GXLB表程序代碼:functionxsz=XSZ(num1,num2)%函數(shù)功能提取誤差系數(shù)A[m1,n1]=size(num1);[m2,n2]=size(num2);n=0;fori=1:m1%用來(lái)判斷參數(shù)個(gè)數(shù)ifnum1(i,2)==1n=n+0;elsen=n+1;endendxsz=zeros(m2,n);%建立系數(shù)陣,全為零fori=1:m2%提取系數(shù)陣q=num2(i,1);z=num2(i,2);xsz(i,z)=1;xsz(i,q)=-1;endend%---------------常數(shù)項(xiàng)L--------------------------------------------------------------functionl=L(num1,num2)[m1,n1]=size(num1);[m2,n2]=size(num2);l=zeros(m2,1);fori=1:m2%計(jì)算lq=num2(i,1);z=num2(i,2);l(i,1)=num2(i,4)-num1(z,4)+num1(q,4);endl=l*1000;%把l從米換算為毫米end%-------------求平差權(quán)陣P------------------------------------------------------------functionp=P1(num1,num2)[m1,n1]=size(num1);[m2,n2]=size(num2);p=zeros(m2,m2);fori=1:m2p(i,i)=1/num2(i,5);endend%------------秩虧自由網(wǎng)平差---------------------------------------------------------------------function[v,Qxx]=PTPCclearallclcglobalH1;globalK1;[num1]=xlsread('DH');K=num1(:,4);K1=K';[m1,n1]=size(num1);%用來(lái)判斷num1得行列[num2]=xlsread('GXLB');[m2,n2]=size(num2);A=XSZ(num1,num2)%誤差方程系數(shù)r=rank(A);%矩陣的秩d=1;%秩虧數(shù)l=L(num1,num2)%誤差方程常數(shù)項(xiàng)單位mmP=P1(num1,num2);%權(quán)N=A'*P*A%法方程系數(shù)W=A'*P*lNN=N*NN0=NN(1:r,1:r);NN_=blkdiag(inv(N0),zeros(d,d));%廣義逆求逆Nm=N*NN_x=Nm*W%-----------高程平差值------H=x/1000+num1(:,4)%單位統(tǒng)一為MH1=H';%----精度評(píng)定-------v=A*x-l%單位mmQxx=N*NN_*N*NN_*Nmsgbox('秩虧自由網(wǎng)普通平差完成')%---------------擬穩(wěn)平差---------------------------------------------------------------------------------------function[v,Qxx]=NWPCclearallglobalH2;globalK1;[num1]=xlsread('DH');K=num1(:,4);K1=K';;[m1,n1]=size(num1);%用來(lái)判斷num1得行列[num2]=xlsread('GXLB');[m2,n2]=size(num2);A=XSZ(num1,num2)%誤差方程系數(shù)r=rank(A);%矩陣的秩d=m1-r;%秩虧數(shù)l=L(num1,num2)%誤差方程常數(shù)項(xiàng)單位mmP=P1(num1,num2);%權(quán)fori=1:m1%找出穩(wěn)定點(diǎn)ifnum1(i,7)==1f(i)=1;elsef(i)=0;endendc1=find(f==1);%找出穩(wěn)定點(diǎn)的下標(biāo)c0=find(f==0);%非穩(wěn)定點(diǎn)下標(biāo)A1=A(:,c0)A2=A(:,c1)N11=A1'*P*A1;N12=A1'*P*A2;N21=N12';N22=A2'*P*A2;M=N22-N21*inv(N11)*N12;r=rank(M);d=1;MM=M*M;M0=MM(1:r,1:r);MM_=blkdiag(inv(M0),zeros(d,d));%廣義逆求逆Mm_=M*MM_;a=(A2'-N21*inv(N11)*A1')';a_=Mm_*a';b_=inv(N11)*(A1'-N12*a_);%-------結(jié)算未知數(shù)-------------------------------------------------------------x2=a_*P*l;x1=b_*P*l;x=[x1;x2]H=x/1000+num1(:,4)%單位統(tǒng)一為MH2=H';%------計(jì)算改正數(shù)---------------------------------------------------------------------------v=A*x-l%------計(jì)算位置參數(shù)協(xié)因數(shù)矩陣-------Qxx=[b_*P*b_'b_*P*a_';a_*P*b_'a_*P*a_']msgbox('秩虧自由網(wǎng)擬穩(wěn)平差完成')-%-------程序界面代碼-----------------------------------------------------------------------------------------functionvarargout=GUI(varargin)gui_Singleton=1;gui_State=struct('gui_Name',mfilename,...'gui_Singleton',gui_Singleton,...'gui_OpeningFcn',@GUI_OpeningFcn,...'gui_OutputFcn',@GUI_OutputFcn,...'gui_LayoutFcn',[],...'gui_Callback',[]);ifnargin&&ischar(varargin{1})gui_State.gui_Callback=str2func(varargin{1});endifnargout[varargout{1:nargout}]=gui_mainfcn(gui_State,varargin{:});elsegui_mainfcn(gui_State,varargin{:});endfunctionGUI_OpeningFcn(hObject,eventdata,handles,varargin)handles.output=hObject;%Updatehandlesstructureguidata(hObject,handles);%---Outputsfromthisfunctionarereturnedtothecommandline.functionvarargout=GUI_OutputFcn(hObject,eventdata,handles)varargout{1}=handles.output;functionradiobutton1_Callback(hObject,eventdata,handles)[v,Qxx]=PTPC;set(handles.uitable1,'Data',v);set(handles.uitable2,'Data',Qxx);globalH1;set(handles.edit4,'string',num2str(H1));globalK1;set(handles.edit3,'string',num2str(K1));functionradiobutton2_Callback(hObject,eventdata,handles)[v,Qxx]=NWPC;set(handles.uitable1,'Data',v);set(handles.uitable2,'Data',Qxx);globalH2;set(handles.edit4,'string',num2str(H2));globalK1;set(handles.edit3,'string',num2str(K1));functionedit1_Callback(hObject,eventdata,handles)functionedit1_CreateFcn(hObject,eventdata,handles)ifispc&&isequal(get(hObject,'BackgroundColor'),get(0,'defaultUicontrolBackgroundColor'))set(hObject,'BackgroundColor','white');endfunctionedit2_Callback(hObject,eventdata,handles)%---Executesduringobjectcreation,aftersettingallproperties.functionedit2_CreateFcn(hObject,eventdata,handles)ifispc&&isequal(get(hObject,'BackgroundColor'),get(0,'defaultUicontrolBackgroundColor'))set(hObject,'BackgroundColor','white');end%---Executeswhenentereddataineditablecell(s)inuitable1.functionuitable1_CellEditCallback(hObject,eventdata,handles)--------------------------------------------------------------------functionUntitled_1_Callback(hObject,eventdata,handles)--------------------------------------------------------------------functionUntitled_2_Callback(hObject,eventdata,handles)h=msgbox({'′?3ìDò?-ê?êy?Yμ???è??úDH(μ?o?±í)oíGXLB£¨1??μáD±í)?D,òà?Y±í???μ?÷??DDêy?Y??è?£?';'???D"1"±íê?ê?"0"±íê?·?'})%DT??×?ì?ah=get(h,'CurrentAxes');ch=get(ah,'Children');set(ch,'FontSize',8);functionedit3_Callback(hObject,eventdata,handles)%---Executesduringobjectcreation,aftersettingallproperties.functionedit3_CreateFcn(hObject,eventdata,handles)ifispc&&isequal(get(hObject,'BackgroundColor'),get(0,'defaultUicontrolBackgroundColor'))set(hObject,'BackgroundColor','white');endfunctionedit4_Callback(hObject,eventdata,handles)%---Executesduringobjectcreation,aftersettingallproperties.functionedit4_CreateFcn(hObject,eventdata,handles)ifispc&&isequal(get(hObject,'Backg

溫馨提示

  • 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。

評(píng)論

0/150

提交評(píng)論