% mcc -m -W mainhg libmwsglm.mlib ray_gui.m !EXE Haline getirmek icin
% kullanilan komut
function varargout = hybrid2_gui(varargin)
% HYBRID2_GUI Application M-file for hybrid2_gui.fig
% FIG = hybrid2_gui launch hybrid2_gui GUI.
% HYBRID2_GUI('callback_name', ...) invoke the named callback.
% Last Modified by GUIDE v2.0 12-Jun-2003 21:16:46
if nargin == 0 % LAUNCH GUI
fig = openfig(mfilename,'reuse');
% Generate a structure of handles to pass to callbacks, and store it.
handles = guihandles(fig);
guidata(fig, handles);
if nargout > 0
varargout{1} = fig;
end
elseif ischar(varargin{1}) % INVOKE NAMED SUBFUNCTION OR CALLBACK
try
if (nargout)
[varargout{1:nargout}] = feval(varargin{:}); % FEVAL switchyard
else
feval(varargin{:}); % FEVAL switchyard
end
catch
disp(lasterr);
end
end
%----------------------------------------------------------------------
%| ABOUT CALLBACKS:
%| GUIDE automatically appends subfunction prototypes to this file, and
%| sets objects' callback properties to call them through the FEVAL
%| switchyard above. This comment describes that mechanism.
%|
%| Each callback subfunction declaration has the following form:
%| <SUBFUNCTION_NAME>(H, EVENTDATA, HANDLES, VARARGIN)
%|
%| The subfunction name is composed using the object's Tag and the
%| callback type separated by '_', e.g. 'slider2_Callback',
%| 'figure1_CloseRequestFcn', 'axis1_ButtondownFcn'.
%|
%| H is the callback object's handle (obtained using GCBO).
%|
%| EVENTDATA is empty, but reserved for future use.
%|
%| HANDLES is a structure containing handles of components in GUI using
%| tags as fieldnames, e.g. handles.figure1, handles.slider2. This
%| structure is created at GUI startup using GUIHANDLES and stored in
%| the figure's application data using GUIDATA. A copy of the structure
%| is passed to each callback. You can store additional information in
%| this structure at GUI startup, and you can change the structure
%| during callbacks. Call guidata(h, handles) after changing your
%| copy to replace the stored original so that subsequent callbacks see
%| the updates. Type "help guihandles" and "help guidata" for more
%| information.
%|
%| VARARGIN contains any extra arguments you have passed to the
%| callback. Specify the extra arguments by editing the callback
%| property in the inspector. By default, GUIDE sets the property to:
%| <MFILENAME>('<SUBFUNCTION_NAME>', gcbo, [], guidata(gcbo))
%| Add any extra arguments after the last argument, before the final
%| closing parenthesis.
% --------------------------------------------------------------------
function varargout = plateHeight_Callback(h, eventdata, handles, varargin)
% --------------------------------------------------------------------
function varargout = source_Callback(h, eventdata, handles, varargin)
% --------------------------------------------------------------------
function varargout = rec_Callback(h, eventdata, handles, varargin)
% --------------------------------------------------------------------
function varargout = slider1_Callback(h, eventdata, handles, varargin)
a = str2num(get(handles.plateHeight,'String'));
set(handles.slider1, 'max', a, 'min' , 0)
slider_value=get(handles.slider1, 'Value');
uu=slider_value;
set(handles.source,'String',num2str(uu));
% --------------------------------------------------------------------
function varargout = slider2_Callback(h, eventdata, handles, varargin)
a = str2num(get(handles.plateHeight,'String'));
set(handles.slider2, 'max', a, 'min' , 0)
slider_value=get(handles.slider2, 'Value');
pp=slider_value;
set(handles.rec,'String',num2str(pp));
% --------------------------------------------------------------------
function varargout = frequency_Callback(h, eventdata, handles, varargin)
% --------------------------------------------------------------------
function varargout = firstRange_Callback(h, eventdata, handles, varargin)
% --------------------------------------------------------------------
function varargout = lastRange_Callback(h, eventdata, handles, varargin)
% --------------------------------------------------------------------
function varargout = rangeStepSize_Callback(h, eventdata, handles, varargin)
% --------------------------------------------------------------------
function varargout = firstReflection_Callback(h, eventdata, handles, varargin)
% --------------------------------------------------------------------
function varargout = lastReflection_Callback(h, eventdata, handles, varargin)
% --------------------------------------------------------------------
% --------------------------------------------------------------------
function varargout = calculateRange_Callback(h, eventdata, handles, varargin)
handles = guihandles(gcbo); % generate handles struct
a = str2num(get(handles.plateHeight,'String'));
fr = str2num(get(handles.frequency,'String'));
k0=2*pi*fr/300
xk=get(handles.slider1, 'Value');
xg=get(handles.slider2, 'Value');
mods=0;
while (k0^2-(mods*pi/a)^2) > 0
mods=mods+1;
beta(mods)=complex(0,0);
if (k0^2-(mods*pi/a)^2) > 0
beta(mods)=sqrt(k0^2-(mods*pi/a)^2);
else
beta(mods)=i*sqrt((mods*pi/a)^2-k0^2);
end
end
z1=str2num(get(handles.firstRange,'String'));
z2=str2num(get(handles.lastRange,'String'));
delz=str2num(get(handles.rangeStepSize,'String'));
nz=(z2-z1)/delz;
mm=mods-1 %input('MOD SAYISI, MM = ?');
set(handles.propagatingModes,'String',num2str(mm));
minangle=str2num(get(handles.firstReflection,'String'));
maxangle=str2num(get(handles.lastReflection,'String'));
minangle=minangle*pi/180;
maxangle=maxangle*pi/180;
% ------------- Calculate Modal Beta values ------------
for mods=1:mm
beta(mods)=complex(0,0);
if (k0^2-(mods*pi/a)^2) > 0
beta(mods)=sqrt(k0^2-(mods*pi/a)^2);
else
beta(mods)=i*sqrt((mods*pi/a)^2-k0^2);
end
end
% -------------------------------------------------------
% ------- RAY SOLUTION (Range Loop Begins) --------------
for zn=1:nz
z=z1+(zn-1)*delz
g1(zn)=complex(0,0);
g2(zn)=complex(0,0);
g3(zn)=complex(0,0);
g4(zn)=complex(0,0);
hybrid(zn)=complex(0,0);
ray(zn)=complex(0,0);
%-------------- Find Rays Between Min. and Max. Angles ------------------
for j=1:4
nr=0;
wn0=maxangle;
n=0;
nray2(j)=0;
nray1(j)=0;
count=0;
while wn0>minangle
if j==1
wn0=fsolve(@myfun1,pi/4,optimset('Display','off'),a,k0,xg,xk,z,nr);
elseif j==2
wn0=fsolve(@myfun2,pi/4,optimset('Display','off'),a,k0,xg,xk,z,nr);
elseif j==3
wn0=fsolve(@myfun3,pi/4,optimset('Display','off'),a,k0,xg,xk,z,nr);
else
wn0=fsolve(@myfun4,pi/4,optimset('Display','off'),a,k0,xg,xk,z,nr);
end
if wn0<maxangle & wn0>minangle
n=n+1;
if j==1
wn1(n)=wn0;
if count==0
nray1(j)=nr;
count=count+1;
end
nray2(j)=nr;
elseif j==2
wn2(n)=wn0;
if count==0
nray1(j)=nr;
count=count+1;
end
nray2(j)=nr;
elseif j==3
wn3(n)=wn0;
if count==0
nray1(j)=nr;
count=count+1;
end
nray2(j)=nr;
else
wn4(n)=wn0;
if count==0
nray1(j)=nr;
count=count+1;
end
nray2(j)=nr;
end
end
nr=nr+1;
end
end
%-------------------Four Rays are calculated ----------------------
for j=1:4
for n=1:(nray2(j)-nray1(j))
nr=nray1(j)+n-1;
if j==1
g1(zn)=g1(zn)+i/(4*pi)*sqrt((2*pi*i)/(k0*abs(q1d2(wn1(n),a,k0,xg,xk,z,nr))))*exp(i*k0*q1(wn1(n),a,k0,xg,xk,z,nr));
elseif j==2
g2(zn)=g2(zn)+i/(4*pi)*sqrt((2*pi*i)/(k0*abs(q2d2(wn2(n),a,k0,xg,xk,z,nr))))*exp(i*k0*q2(wn2(n),a,k0,xg,xk,z,nr));
elseif j==3
g3(zn)=g3(zn)+i/(4*pi)*sqrt((2*pi*i)
没有合适的资源?快使用搜索试试~ 我知道了~
RAY.zip_ GUIDATA and GCBO_ray-tracing wireless_startup
共4个文件
m:2个
fig:2个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 59 浏览量
2022-09-14
18:34:15
上传
评论
收藏 18KB ZIP 举报
温馨提示
simple wireless raytrace HANDLES is a structure containing handles of components in GUI using | tags as fieldnames, e.g. handles.figure1, handles.slider2. This | structure is created at GUI startup using GUIHANDLES and stored in | the figure s application data using GUIDATA. A copy of the structure | is passed to each callback. You can store additional information in | this structure at GUI startup, and you can change the structure | during callbacks. Call guidata(h, handles) after changing your | copy to replace the stored original so that subsequent callbacks see | the updates. Type "help guihandles" and "help guidata" for more | information.
资源推荐
资源详情
资源评论
收起资源包目录
RAY.zip (4个子文件)
ray_gui.m 16KB
hybrid2_gui.fig 53KB
ray_gui.fig 47KB
hybrid2_gui.m 24KB
共 4 条
- 1
资源评论
局外狗
- 粉丝: 64
- 资源: 1万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功