版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡介
完成時(shí)間完成時(shí)間2012年5月16日光柵衍射實(shí)驗(yàn)的MATLAB仿真姓名吳帥系別、專業(yè)物理與電子信息工程系應(yīng)用物理專業(yè)導(dǎo)師姓名、職稱姚敏教授目錄TOC\o"1-5"\h\z摘要IABSTRACTII\o"CurrentDocument"引言1國內(nèi)外研究動態(tài)1理論依據(jù)2平面光柵衍射實(shí)驗(yàn)裝置2原理分析3MATLAB主程序的編寫6仿真圖形的用戶界面設(shè)計(jì)7光柵衍射現(xiàn)象的分析83.1縫數(shù)N對衍射條紋的影響83.2波長入對衍射條紋的影響103.3光柵常數(shù)d對衍射光強(qiáng)的影響12條紋缺級現(xiàn)象13\o"CurrentDocument"總結(jié)14\o"CurrentDocument"參考文獻(xiàn)16致謝17附錄18#附錄GUI界面的M文件封裝的主程序代碼functionvarargout=hg(varargin)%HGM-fileforhg.fig%HG,byitself,createsanewHGorraisestheexisting%singleton*.%%H=HGreturnsthehandletoanewHGorthehandleto%theexistingsingleton*.%%HG('CALLBACK',hObject,eventData,handles,...)callsthelocal%functionnamedCALLBACKinHG.Mwiththegiveninputarguments.%%HG('Property','Value',...)createsanewHGorraisesthe%existingsingleton*.Startingfromtheleft,propertyvaluepairsare%appliedtotheGUIbeforehg_OpeningFcngetscalled.An%unrecognizedpropertynameorinvalidvaluemakespropertyapplication%stop.Allinputsarepassedtohg_OpeningFcnviavarargin.%%*SeeGUIOptionsonGUIDE'sToolsmenu.Choose"GUIallowsonlyone%instancetorun(singleton)".%%Seealso:GUIDE,GUIDATA,GUIHANDLES%Edittheabovetexttomodifytheresponsetohelphg%LastModifiedbyGUIDEv2.521-May-201201:34:22%Begininitializationcode-DONOTEDITgui_Singleton=1;gui_State=struct('gui_Name',mfilename,...'gui_Singleton',gui_Singleton,...'gui_OpeningFcn',@hg_OpeningFcn,...'gui_OutputFcn',@hg_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{:});end%Endinitializationcode-DONOTEDIT%Executesjustbeforehgismadevisible.functionhg_OpeningFcn(hObject,eventdata,handles,varargin)%Thisfunctionhasnooutputargs,seeOutputFcn.%hObjecthandletofigure%eventdatareserved-tobedefinedinafutureversionofMATLAB%handlesstructurewithhandlesanduserdata(seeGUIDATA)%varargincommandlineargumentstohg(seeVARARGIN)%Choosedefaultcommandlineoutputforhgset(handles.edit4,'String',0.000005);set(handles.edit1,'String',1);set(handles.edit2,'String',600e-9);set(handles.edit3,'String',0.00001);handles.output=hObject;%Updatehandlesstructureguidata(hObject,handles);%UIWAITmakeshgwaitforuserresponse(seeUIRESUME)%uiwait(handles.figure1);%Outputsfromthisfunctionarereturnedtothecommandline.functionvarargout=hg_OutputFcn(hObject,eventdata,handles)%varargoutcellarrayforreturningoutputargs(seeVARARGOUT);%hObjecthandletofigure%eventdatareserved-tobedefinedinafutureversionofMATLAB%handlesstructurewithhandlesanduserdata(seeGUIDATA)%Getdefaultcommandlineoutputfromhandlesstructurevarargout{1}=handles.output;%Executesonslidermovement.functionslider1_Callback(hObject,eventdata,handles)%hObjecthandletoslider1(seeGCBO)%eventdatareserved-tobedefinedinafutureversionofMATLAB%handlesstructurewithhandlesanduserdata(seeGUIDATA)%Hints:get(hObject,'Value')returnspositionofslider%get(hObject,'Min')andget(hObject,'Max')todeterminerangeofsliderN=get(handles.slider1,'value');set(handles.edit1,'string',num2str(N));%Executesduringobjectcreation,aftersettingallproperties.functionslider1_CreateFcn(hObject,eventdata,handles)%hObjecthandletoslider1(seeGCBO)%eventdatareserved-tobedefinedinafutureversionofMATLAB%handlesempty-handlesnotcreateduntilafterallCreateFcnscalled%Hint:slidercontrolsusuallyhavealightgraybackground.ifisequal(get(hObject,'BackgroundColor'),get(0,'defaultUicontrolBackgroundColor'))set(hObject,'BackgroundColor',[.9.9.9]);end%Executesonslidermovement.functionslider2_Callback(hObject,eventdata,handles)%hObjecthandletoslider2(seeGCBO)%eventdatareserved-tobedefinedinafutureversionofMATLAB%handlesstructurewithhandlesanduserdata(seeGUIDATA)%Hints:get(hObject,'Value')returnspositionofslider%get(hObject,'Min')andget(hObject,'Max')todeterminerangeofsliderl=get(handles.slider2,'value');set(handles.edit2,'string',num2str(l));%Executesduringobjectcreation,aftersettingallproperties.functionslider2_CreateFcn(hObject,eventdata,handles)%hObjecthandletoslider2(seeGCBO)%eventdatareserved-tobedefinedinafutureversionofMATLAB%handlesempty-handlesnotcreateduntilafterallCreateFcnscalled%Hint:slidercontrolsusuallyhavealightgraybackground.ifisequal(get(hObject,'BackgroundColor'),get(0,'defaultUicontrolBackgroundColor'))set(hObject,'BackgroundColor',[.9.9.9]);end%Executesonslidermovement.functionslider3_Callback(hObject,eventdata,handles)%hObjecthandletoslider3(seeGCBO)%eventdatareserved-tobedefinedinafutureversionofMATLAB%handlesstructurewithhandlesanduserdata(seeGUIDATA)%Hints:get(hObject,'Value')returnspositionofslider%get(hObject,'Min')andget(hObject,'Max')todeterminerangeofsliderd=get(handles.slider3,'value');set(handles.edit3,'string',num2str(d));%Executesduringobjectcreation,aftersettingallproperties.functionslider3_CreateFcn(hObject,eventdata,handles)%hObjecthandletoslider3(seeGCBO)%eventdatareserved-tobedefinedinafutureversionofMATLAB%handlesempty-handlesnotcreateduntilafterallCreateFcnscalled%Hint:slidercontrolsusuallyhavealightgraybackground.ifisequal(get(hObject,'BackgroundColor'),get(0,'defaultUicontrolBackgroundColor'))set(hObject,'BackgroundColor',[.9.9.9]);end%Executesonbuttonpressinpushbutton1.functionpushbutton1_Callback(hObject,eventdata,handles)%hObjecthandletopushbutton1(seeGCBO)%eventdatareserved-tobedefinedinafutureversionofMATLAB%handlesstructurewithhandlesanduserdata(seeGUIDATA)N=str2num(get(handles.edit1,'String'));l=str2num(get(handles.edit2,'String'));d=str2num(get(handles.edit3,'String'));f=40;b=str2num(get(handles.edit4,'String'));x=linspace(-4*pi,4*pi,1000);forj=1:1000u=(pi*b/l)*(((x(j)/sqrt(x(j)人2+02))));Idan(j)=((sin(u)/u).人2);Iduo(j)=((sin(d*u*N/b)/sin(d*u/b)).人2);I(j)=Idan(j)*Iduo(j);endNCLevels=255;Ir=NCLevels*I;IG=NCLevels*Idan;IB=NCLevels*Iduo;axes(handles.axes1);colormap(gray(NCLevels));switchN%選擇相應(yīng)的標(biāo)頭case1image(x,Idan,IG)title('單縫衍射仿真結(jié)果')axes(handles.axes2);plot(x,Idan(:)/max(Idan));case2image(x,Iduo,IB)title('雙縫干涉仿真結(jié)果')axes(handles.axes2);plot(x,Iduo(:)/max(Iduo));otherwiseimage(x,I,Ir)title('光柵衍射仿真結(jié)果')axes(handles.axes2);plot(x,I(:)/max(I));end%Executesonbuttonpressinpushbutton2.functionpushbutton2_Callback(hObject,eventdata,handles)%hObjecthandletopushbutton2(seeGCBO)%eventdatareserved-tobedefinedinafutureversionofMATLAB%handlesstructurewithhandlesanduserdata(seeGUIDATA)closefunctionedit1_Callback(hObject,eventdata,handles)%hObjecthandletoedit1(seeGCBO)%eventdatareserved-tobedefinedinafutureversionofMATLAB%handlesstructurewithhandlesanduserdata(seeGUIDATA)%Hints:get(hObject,'String')returnscontentsofedit1astext%str2double(get(hObject,'String'))returnscontentsofedit1asadouble%Executesduringobjectcreation,aftersettingallproperties.functionedit1_CreateFcn(hObject,eventdata,handles)%hObjecthandletoedit1(seeGCBO)%eventdatareserved-tobedefinedinafutureversionofMATLAB%handlesempty-handlesnotcreateduntilafterallCreateFcnscalled%Hint:editcontrolsusuallyhaveawhitebackgroundonWindows.%SeeISPCandCOMPUTER.ifispc&&isequal(get(hObject,'BackgroundColor'),get(0,'defaultUicontrolBackgroundColor'))set(hObject,'BackgroundColor','white');endfunctionedit2_Callback(hObject,eventdata,handles)%hObjecthandletoedit2(seeGCBO)%eventdatareserved-tobedefinedinafutureversionofMATLAB%handlesstructurewithhandlesanduserdata(seeGUIDATA)%Hints:get(hObject,'String')returnscontentsofedit2astext%str2double(get(hObject,'String'))returnscontentsofedit2asadouble%Executesduringobjectcreation,aftersettingallproperties.functionedit2_CreateFcn(hObject,eventdata,handles)%hObjecthandletoedit2(seeGCBO)%eventdatareserved-tobedefinedinafutureversionofMATLAB%handlesempty-handlesnotcreateduntilafterallCreateFcnscalled%Hint:editcontrolsusuallyhaveawhitebackgroundonWindows.%SeeISPCandCOMPUTER.ifispc&&isequal(get(hObject,'BackgroundColor'),get(0,'defaultUicontrolBackgroundColor'))set(hObject,'BackgroundColor','white');endfunctionedit3_Callback(hObject,eventdata,handles)%hObjecthandletoedit3(seeGCBO)%eventdatareserved-tobedefinedinafutureversionofMATLAB%handlesstructurewithhandlesanduserdata(seeGUIDATA)%Hints:get(hObject,'String')returnscontentsofedit3astext%str2double(get(hObject,'String'))returnscontentsofedit3asadouble%Executesduringobjectcreation,aftersettingallproperties.functionedit3_CreateFcn(hObject,eventdata,handles)%hObjecthandletoedit3(seeGCBO)%eventdatareserved-tobedefinedinafutureversionofMATLAB%handlesempty-handlesnotcreateduntilafterallCreateFcnscalled%Hint:editcontrolsusuallyhaveawhitebackgro
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 高考全國二卷政治考試題庫及答案
- 九年級上冊英語月考試題題庫(含答案)
- 企業(yè)公關(guān)招聘題目及解析
- 產(chǎn)品經(jīng)理面試題及需求分析技巧含答案
- 銷售代表筆試題庫及答案
- 設(shè)備維修工面試問題集
- 訪問控制保密工程師考試題集含答案
- 采購協(xié)調(diào)員面試問題及答案
- 定點(diǎn)復(fù)印合同范本
- 市場轉(zhuǎn)讓合同范本
- 鋼鐵廠勞務(wù)合同范本
- 2025年沈陽華晨專用車有限公司公開招聘筆試考試備考題庫及答案解析
- 職業(yè)技能競賽和技術(shù)比武活動方案
- 2025課堂懲罰 主題班會:馬達(dá)加斯加企鵝課堂懲罰 課件
- 藥品生產(chǎn)企業(yè)銷售模式、組織架構(gòu)及崗位設(shè)置-藥品生產(chǎn)企業(yè)銷售部門組
- 鄉(xiāng)村振興背景下農(nóng)村集體經(jīng)濟(jì)發(fā)展問題
- 小型水工建筑物設(shè)計(jì)基本知識-水工建筑物的安全加高
- 燃?xì)鈭?bào)警施工方案
- 保安員基本條件及行為規(guī)范
- 家裝設(shè)計(jì)的職責(zé)【部門職能】1、接待裝-112702874
- 艾堅(jiān)蒙(安慶)科技發(fā)展有限公司年產(chǎn)4000噸光固化引發(fā)劑系列產(chǎn)品項(xiàng)目環(huán)境影響報(bào)告書
評論
0/150
提交評論