(一)主程序变量说明:输入变量:zo传输线特性阻抗zl传输线终端负载阻抗Er传输线介电常数f传输电磁波的频率由输入变量计算得出的变量:w传输电磁波的数字角频率len传输电磁波的相波长beita相移常数gama传输线个点反射系数复值gamal传输线终端反射系数的模rou驻波系数k行波系数Zi传输线各点输入阻抗的复值Ui传输线各点输入电压的复值Uo传输线各点输出电压的复值Uit传输线各点输入电压的瞬时值Uot传输线各点输出电压的瞬时值Ii传输线各点输入电流的复值Io传输线各点输出电流的复值Is传输线各点合成电流的复值Us传输线各点合成电压的复值Ist传输线各点合成电流的瞬时值Ust传输线各点合成电压的瞬时值ph传输线各点合成电压的相位(二)主程序流程说明:本程序的界面中共有三个输入编辑框,三个输出编辑框和五个波形显示窗口,分别用来输入:传输线特性阻抗Z0、传输线终端负载阻抗ZL、传输的电磁波的频率f、传输线传输介质的相对介电常数εr;输出:传输线的终端反射系数ΓL、行波系数ρ、驻波系数K;具体的程序思路如下:1.由输入编辑框获得用户输入的Z0、ZL、f和εr;2.在“开始”按钮的callback函数中进行运算,并控制各个axis的显示;3.图形的动态显示由一个while循环实现,并由全局标记变量flag控制;4.在“停止”按钮的callback函数中令flag=1,while循环跳出。(三)程序运行效果1.行波演示中端接匹配负载zo=zl=50Ω2.驻波演示1)终端短路zo=50Ωzl=02)终端开路zo=50Ωzl=inf3)终端接纯电抗负载zo=50Ωzl=X*j3.行驻波演示(四)主程序代码functionvarargout=StatusAnaly(varargin)%********************************************************%%Copyright(C),2009-2012,Lyric%%FileName:StatusAnaly.m%%Author:Lyric%%Version:1.0%%Date:2010-05-11%%********************************************************%%STATUSANALYM-fileforStatusAnaly.fig%STATUSANALY,byitself,createsanewSTATUSANALYorraisestheexisting%singleton*.%%H=STATUSANALYreturnsthehandletoanewSTATUSANALYorthehandleto%theexistingsingleton*.%%STATUSANALY('CALLBACK',hObject,eventData,handles,...)callsthelocal%functionnamedCALLBACKinSTATUSANALY.Mwiththegiveninputarguments.%%STATUSANALY('Property','Value',...)createsanewSTATUSANALYorraisesthe%existingsingleton*.Startingfromtheleft,propertyvaluepairsare%appliedtotheGUIbeforeStatusAnaly_OpeningFcngetscalled.An%unrecognizedpropertynameorinvalidvaluemakespropertyapplication%stop.AllinputsarepassedtoStatusAnaly_OpeningFcnviavarargin.%%*SeeGUIOptionsonGUIDE'sToolsmenu.ChooseGUIallowsonlyone%instancetorun(singleton).%%Seealso:GUIDE,GUIDATA,GUIHANDLES%EdittheabovetexttomodifytheresponsetohelpStatusAnaly%LastModifiedbyGUIDEv2.511-May-201014:30:20%Begininitializationcode-DONOTEDITgui_Singleton=1;gui_State=struct('gui_Name',mfilename,...'gui_Singleton',gui_Singleton,...'gui_OpeningFcn',@StatusAnaly_OpeningFcn,...'gui_OutputFcn',@StatusAnaly_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%---ExecutesjustbeforeStatusAnalyismadevisible.functionStatusAnaly_OpeningFcn(hObject,eventdata,handles,varargin)%Thisfunctionhasnooutputargs,seeOutputFcn.%hObjecthandletofigure%eventdatareserved-tobedefinedinafutureversionofMATLAB%handlesstructurewithhandlesanduserdata(seeGUIDATA)%varargincommandlineargumentstoStatusAnaly(seeVARARGIN)%ChoosedefaultcommandlineoutputforStatusAnalyhandles.output=hObject;%Updatehandlesstructureguidata(hObject,handles);%UIWAITmakesStatusAnalywaitforuserresponse(seeUIRESUME)%uiwait(handles.figure1);%---Outputsfromthisfunctionarereturnedtothecommandline.functionvarargout=StatusAnaly_OutputFcn(hObject,eventdata,handles)%varargoutcellarrayforreturningoutputargs(seeVARARGOUT);%hObjecthandletofigure%eventdatareserved-tobedefinedinafutureversionofMATLAB%handlesstructurewithhandlesanduserdata(seeGUIDATA)%Getdefaultcommandlineoutputfromhandlesstructurevarargout{1}=handles.output;functionedit_zo_Callback(hObject,eventdata,handles)%hObjecthandletoedit_zo(seeGCBO)%eventdatareserved-tobedefinedinafutureversionofMATLAB%handlesstructurewithhandlesanduserdata(seeGUIDATA)%Hints:get(hObject,'String')returnscontentsofedit_zoastext%str2double(get(hObject,'String'))returnscontentsofedit_zoasadouble%---Executesduringobjectcreation,aftersettingallproperties.functionedit_zo_CreateFcn(hObject,eventdata,handles)%hObjecthandletoedit_zo(seeGCBO)%eventdatareserved-tobedefinedinafutureversionofMATLAB%handlesempty-handlesnotcreateduntilafterallCreateFcnscalled%Hint:editcontrolsusuallyhaveawhitebackgroundonWindows.%SeeISPCandCOMPUTER.ifispc&&isequal(get(hObject,'BackgroundColor'),get(0,'defaultUicontrolBackgroundColor'))set(hObject,'BackgroundColor','white');endfunctionedit_zl_Callback(hObject,eventdata,handles)%hObjecthandletoedit_zl(seeGCBO)%eventdatareserved-tobedefinedinafutureversionofMATLAB%handlesstructurewithhandlesanduserdata(seeGUIDATA)%Hints:get(hObject,'String')returnscontentsofedit_zlastext%str2double(get(hObject,'String'))returnscontentsofedit_zlasadouble%---Executesduringobjectcreation,aftersettingallproperties.functionedit_zl_CreateFcn(hObject,eventdata,handles)%hObjecthandletoedit_zl(seeGCBO)%eventdatareserved-tobedefinedinafutureversionofMATLAB%handlesempty-handlesnotcreateduntilafterallCreateFcnscalled%Hint:editcontrolsusuallyhaveawhitebackgroundonWindows.%SeeISPCandCOMPUTER.ifispc&&isequal(get(hObject,'BackgroundColor'),get(0,'defaultUicontrolBackgroundColor'))set(hObject,'BackgroundColor','white');end%---Executesonbuttonpressinbtn_begin.functionbtn_begin_Callback(hObject,eventdata,handles)%hObjecthandletobtn_begin(seeGCBO)%eventdatareserved-tobedefinedinafutureversionofMATLAB%handlesstructurewithhandlesanduserdata(seeGUIDATA)%获得传输线特性阻抗temp=get(handles.