微波实验报告 smith原图 matlab(2)

2019-03-03 22:35

%

% H = LIUJIAQINGNEW returns the handle to a new LIUJIAQINGNEW or the handle to

% the existing singleton*. %

% LIUJIAQINGNEW('CALLBACK',hObject,eventData,handles,...) calls the local

% function named CALLBACK in LIUJIAQINGNEW.M with the given input arguments. %

% LIUJIAQINGNEW('Property','Value',...) creates a new LIUJIAQINGNEW or raises the

% existing singleton*. Starting from the left, property value pairs are

% applied to the GUI before liujiaqingnew_OpeningFcn gets called. An

% unrecognized property name or invalid value makes property application

% stop. All inputs are passed to liujiaqingnew_OpeningFcn via varargin. %

% *See GUI Options on GUIDE's Tools menu. Choose \only one

% instance to run (singleton)\ %

% See also: GUIDE, GUIDATA, GUIHANDLES

% Edit the above text to modify the response to help liujiaqingnew

% Last Modified by GUIDE v2.5 07-Jun-2013 00:23:26

% Begin initialization code - DO NOT EDIT gui_Singleton = 1;

gui_State = struct('gui_Name', mfilename, ...

'gui_Singleton', gui_Singleton, ... 'gui_OpeningFcn', @liujiaqingnew_OpeningFcn, ...

'gui_OutputFcn', @liujiaqingnew_OutputFcn, ... 'gui_LayoutFcn', [] , ... 'gui_Callback', []); if nargin && ischar(varargin{1})

gui_State.gui_Callback = str2func(varargin{1}); end

if nargout

[varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:}); else

gui_mainfcn(gui_State, varargin{:}); end

% End initialization code - DO NOT EDIT

% --- Executes just before liujiaqingnew is made visible.

function liujiaqingnew_OpeningFcn(hObject, eventdata, handles, varargin)

% This function has no output args, see OutputFcn. % hObject handle to figure

% eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % varargin command line arguments to liujiaqingnew (see VARARGIN)

% Choose default command line output for liujiaqingnew handles.output = hObject;

% Update handles structure guidata(hObject, handles);

% UIWAIT makes liujiaqingnew wait for user response (see UIRESUME) % uiwait(handles.figure1);

% --- Outputs from this function are returned to the command line. function varargout = liujiaqingnew_OutputFcn(hObject, eventdata, handles)

% varargout cell array for returning output args (see VARARGOUT); % hObject handle to figure

% eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA)

% Get default command line output from handles structure varargout{1} = handles.output;

% --- Executes on button press in pushbutton7.

function pushbutton7_Callback(hObject, eventdata, handles) % hObject handle to pushbutton7 (see GCBO)

% eventdata reserved - to be defined in a future version of MATLAB

% handles structure with handles and user data (see GUIDATA) %handles(axes1);

for R0=[0 0.2 0.5 1 2 ];

for X0=[-4 -2 -1 -0.5 -0.3 0.3 0.5 1 2 4];%循环输入归一化阻抗 tr=2*pi*(0:0.005:1); rr=1/(1+R0);cr=1-rr;

plot(cr+rr*cos(tr),rr*sin(tr),'g');%画电阻圆 axis square; hold on; x=X0;

rx=1/x;cx=rx;

tx=2*atan(x)*(0:0.01:1); if tx

plot(1-rx*sin(tx),cx-rx*cos(tx),'g')%画电抗圆 else

plot(1-rx*sin(tx),-cx-rx*cos(tx),'g') end

hold on; end end

t=-1:0.001:1;%画横轴 plot(t,0,'g'); axis square; hold on;

R0= get(handles.R ,'string');%提取电阻电抗值 X0 = get(handles.X ,'string'); Zo= get(handles.Zo ,'string'); R0=str2double(R0);%格式转换 转换为数值 X0=str2double(X0); Zo=str2double(Zo); %归一化 R=R0/Zo; X=X0/Zo;

%画smith图

U=(R^2+X^2-1)/(R^2+2*R+1+X^2);%转化为坐标值 即U V V=2*X/(R^2+2*R+1+X^2); tr=2*pi*(0:0.00001:1);

cosA=U/sqrt(U^2+V^2);%画相角线 sinA=V/sqrt(U^2+V^2); r0=0:0.00001:1;

g0=plot(r0*cosA,r0*sinA,'k','linewidth',1.5);

axis square; hold on;

rr=1/(1+R);cr=1-rr;

g1=plot(cr+rr*cos(tr),rr*sin(tr),'r','linewidth',1.5);%画电阻圆 axis square; hold on; x=X;

rx=1/x;cx=rx;

tx=2*atan(x)*(0:0.0001:1); if tx

g2=plot(1-rx*sin(tx),cx-rx*cos(tx),'m','linewidth',1.5);%画电抗圆 else

g3=plot(1-rx*sin(tx),-cx-rx*cos(tx),'m','linewidth',1.5); end

hold on;

r=sqrt(U^2+V^2);

g4=plot(r*cos(tr),r*sin(tr),'--','linewidth',1.5);% 等反射系数圆的半径

axis square; hold on;

G=R/(R^2+X^2);%导纳 B=-X/(R^2+X^2);

U=(R^2+X^2-1)/(R^2+2*R+1+X^2);%反射系数 V=2*X/(R^2+2*R+1+X^2);

zhu_bo_bi=(1+sqrt(U^2+V^2))/(1-sqrt(U^2+V^2));%驻波比 xing_bo_xi_shu=1/zhu_bo_bi; %行波系数 A0=atan(V/U); %相位角 if U<0

A=(180/pi)*(A0+pi); elseif V>=0

A=(180/pi)*A0; else

A=(180/pi)*(A0+2*pi); end if V>=0

L=(0.5/360)*(180-A); else

L=0.75-(0.5/360)*A;

end %波长数 %匹配问题

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

z=R+j*X;

Gamma2=(z-1)/(z+1); Mod=abs(Gamma2); Phi=angle(Gamma2); if X0<0

if(Phi>=0)

Lmin=Phi/(4*pi); Lmax=0.25+Lmin; else

Lmin=(pi+Phi)/(4*pi); Lmax=0.25+Lmin; end else

if(Phi>=0)

Lmax=Phi/(4*pi); Lmin=0.25+Lmax; else

Lmax=(pi+Phi)/(4*pi); Lmin=0.25+Lmax; end

hold off; end

rho=(1+abs(Gamma2))/(1-abs(Gamma2)); Zo1=Zo*sqrt(rho); Zo2=Zo/sqrt(rho);

set(handles.Ht5,'string',strcat('在L1=',num2str(Lmax),'λ处并接入特性阻抗为 Zo1 = ', num2str(Zo1),' Ω 的λ/4传输线可实现匹配'),'fontname','宋体','fontsize',12);

set(handles.Ht6,'string',strcat('或在L2=',num2str(Lmin),'λ处并接入特性阻抗为 Zo2 = ', num2str(Zo2),' Ω 的λ/4传输线可实现匹配'),'fontname','宋体','fontsize',12);

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%显示各种参数值

G = num2str(G); % 转换为字符串 set(handles.G,'string',G); B = num2str(B); % 转换为字符串 set(handles.B,'string',B);

zhu_bo_bi= num2str(zhu_bo_bi); % 转换为字符串 set(handles.zhu_bo_bi,'string',zhu_bo_bi);

xing_bo_xi_shu = num2str(xing_bo_xi_shu); % 转换为字符串 set(handles.xing_bo_xi_shu,'string',xing_bo_xi_shu);


微波实验报告 smith原图 matlab(2).doc 将本文的Word文档下载到电脑 下载失败或者文档不完整,请联系客服人员解决!

下一篇:房地产估价报告9 - 图文

相关阅读
本类排行
× 注册会员免费下载(下载后可以自由复制和排版)

马上注册会员

注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信: QQ: