📄 yagiudasimulate.m
字号:
function YagiSimulate(handles)
% this function will export the final design to
% superNEC for further simulation
% INPUTS:
% modelFreq: The frequency at which the SNEC structure is designed
% obj.location: The location of the assembly
% obj.segLength: The segment length in wavelengths
% obj.orientation: The orientation of the assembly
% obj.freqScale: The factor by which the model freq. is scaled
% obj.spacing: The spacing between the elements
% obj.len: The length of the yagi elements
% obj.radii: The radii of the yagi elements
snecin
clear snres;
strdll ('New');
% snecFileName = ['c:\MATLAB7\snec\matlab\YagiPlot.nec'];
% outputFileName = ['c:\MATLAB7\snec\matlab\YagiPlot.out'];
clear snres;
boomlength = get(handles.Parameter1,'Value');
dir_no = get(handles.Parameter2,'Value');
ref_len = get(handles.Parameter4,'Value');
ratio = get(handles.Parameter5,'Value');
modelFreq = get(handles.Frequency,'Value');
dir_len = ref_len/ratio;
if ~get(handles.Units,'Value')
lambda = 300/modelFreq;
else
lambda = 1;
end
rad = 0.01;
spa = ((boomlength*lambda)/(dir_no-1));
spa = str2double(sprintf('%1.2e',spa));
spaces = zeros(dir_no,1)' + spa;
radius = zeros(dir_no,1)' + rad;
dir_len = str2double(sprintf('%1.2e',dir_len*lambda));
ref_len = str2double(sprintf('%1.2e',ref_len*lambda));
lengths = zeros(dir_no,1)' + dir_len;
lengths(1) = ref_len;
strdll ('SetModelFreq', modelFreq);
obj.location = [0.000, 0.000, 0.000];
obj.segLength = 0.100;
obj.orientation = [0.000, 0.000, 0.000];
obj.freqScale = 1.000;
obj.spacing = spaces;
obj.len = lengths;
obj.radii = radius;
% Segment the yagi using the yagi assembly
yagi = snyagi(modelFreq, obj, 0);
% Add it to the structure.
strdll ('AddAssembly', yagi);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -