📄 pol_urbmacro.m
字号:
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of txtU as txtS
% str2double(get(hObject,'String')) returns contents of txtU as a double
% --- Executes during object creation, after setting all properties.
function txtU_CreateFcn(hObject, eventdata, handles)
% hObject handle to txtU (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
function txtrAS_Callback(hObject, eventdata, handles)
% hObject handle to txtrAS (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of txtrAS as txtS
% str2double(get(hObject,'String')) returns contents of txtrAS as a double
% --- Executes during object creation, after setting all properties.
function txtrAS_CreateFcn(hObject, eventdata, handles)
% hObject handle to txtrAS (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
function txtt_Callback(hObject, eventdata, handles)
% hObject handle to txtt (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of txtt as txtS
% str2double(get(hObject,'String')) returns contents of txtt as a double
% --- Executes during object creation, after setting all properties.
function txtt_CreateFcn(hObject, eventdata, handles)
% hObject handle to txtt (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
function txtX_Callback(hObject, eventdata, handles)
% hObject handle to txtX (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of txtX as txtS
% str2double(get(hObject,'String')) returns contents of txtX as a double
% --- Executes during object creation, after setting all properties.
function txtX_CreateFcn(hObject, eventdata, handles)
% hObject handle to txtX (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
% --- Executes during object creation, after setting all properties.
function bsantenna_CreateFcn(hObject, eventdata, handles)
% hObject handle to bsantenna (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% --------------------------------------------------------------------
function bsantenna_SelectionChangeFcn(hObject, eventdata, handles)
% hObject handle to bsantenna (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% --- Executes on button press in pushbutton1.
function pushbutton1_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
A=get(handles.radiobutton20, 'Value');
if A==1
BSAP=1;%dipoles
else
BSAP=2;%cross dipoles
end
B=get(handles.radiobutton27, 'Value');
if B==1
MSAP=1;%tilted dipoles
else
MSAP=2;%cross dipoles
end
valR=str2double(get(handles.txtR,'string'));
if isnan(valR) | valR<=0 | mod(valR,floor(valR))~=0
errordlg('Wrong Input for parameter R, R must be non zero natural','Error')
return
end
b=get(handles.radiobutton12, 'Value');
if b==1
[vald valthetaBS valthetaMS valomegaBS valomegaMS valthetav]=OrientationsFixBS(valR);
else
vald=str2double(get(handles.resd,'string'));
if isnan(vald) | vald<=0 | vald>valR
errordlg('Wrong Input for parameter d, d must be a non zero natural smaller or equal to R','Error')
return
end
valomegaMS=str2double(get(handles.resomegaMS,'string'));
if isnan(valomegaMS) | valomegaMS<0 | valomegaMS>360
errordlg('Wrong Input for parameter Omega MS, Omega MS must be positive real smaller than 360','Error')
return
end
valthetaBS=str2double(get(handles.resthetaBS,'string'));
if isnan(valthetaBS) | valthetaBS<0 | valthetaBS>360
errordlg('Wrong Input for parameter Theta BS, Theta BS must be positive real smaller than 360','Error')
return
end
valomegaBS=str2double(get(handles.resomegaBS,'string'));
if isnan(valomegaBS) | valomegaBS<0 | valomegaBS>360
errordlg('Wrong Input for parameter Omega BS, Omega BS must be positive real smaller than 360','Error')
return
end
valthetav=str2double(get(handles.resthetav,'string'));
if isnan(valthetav) | valthetav<0 | valthetav>360
errordlg('Wrong Input for parameter Theta v, Theta v must be positive real smaller than 360','Error')
return
end
valthetaMS=round(abs(valomegaBS-valomegaMS+valthetaBS+180));
end
valaBS=str2double(get(handles.edit42,'string'));
if valaBS<0 | valaBS>90
errordlg('Wrong Input for parameter aBS, aBS must be greater or equal to zero and smaller or equal to 90','Error')
return
end
valbMS=str2double(get(handles.edit45,'string'));
if valbMS<0 | valbMS>90
errordlg('Wrong Input for parameter aBS, aBS must be greater or equal to zero and smaller or equal to 90','Error')
return
end
valXPDdB=str2double(get(handles.txtXPD,'string'));
if isnan(valXPDdB) | valXPDdB<0
errordlg('Wrong Input for parameter XPD, XPD must be a positive real','Error')
return
end
XPD=10^(valXPDdB/10);
valrn=1/XPD;
valS=str2double(get(handles.txtS,'string'));
if isnan(valS) | valS<=0 | mod(valS,floor(valS))~=0
errordlg('Wrong Input for parameter S, S must be non zero natural','Error')
return
end
valU=str2double(get(handles.txtU,'string'));
if isnan(valU) | valU<=0 | mod(valU,floor(valU))~=0
errordlg('Wrong Input for parameter U, U must be non zero natural','Error')
return
end
valdBS=eval(get(handles.txtdBS,'string'));
if length(valdBS)~=(valS-1) & valS~=1
errordlg('Check the Input distances at the Base Station','Error')
return
elseif valS==1
valdBS=0;
end
valdMS=eval(get(handles.txtdMS,'string'));
if length(valdMS)~=(valU-1) & valU~=1
errordlg('Check the Input distances at the Mobile Station','Error')
return
elseif valU==1
valdMS=0;
end
valN=str2double(get(handles.txtN,'string'));
if isnan(valN) | valN<=0 | mod(valN,floor(valN))~=0
errordlg('Wrong Input for parameter N, N must be non zero natural','Error')
return
elseif valN>18
errordlg('Input for parameter N too big, N must be smaller than 18','Error')
return
end
valM=str2double(get(handles.txtM,'string'));
if isnan(valM) | valM<=0 | mod(valM,floor(valM))~=0
errordlg('Wrong Input for parameter M, M must be non zero natural','Error')
return
end
valfc=str2double(get(handles.txtfc,'string'));
if isnan(valfc) | valfc<=0
errordlg('Wrong Input for parameter fc, fc must be non zero positive real','Error')
return
end
valv=str2double(get(handles.txtv,'string'));
if isnan(valv) | valv<0
errordlg('Wrong Input for parameter v, v must be non zero positive real','Error')
return
end
valrDS=str2double(get(handles.txtrDS,'string'));
if isnan(valrDS) | valrDS<=0
errordlg('Wrong Input for parameter rDS, rDS must be non zero positive real','Error')
return
end
valrAS=str2double(get(handles.txtrAS,'string'));
if isnan(valrAS) | valrAS<=0
errordlg('Wrong Input for parameter rAS, rAS must be non zero positive real','Error')
return
end
valBSAS=str2double(get(handles.txtBSAS,'string'));
if isnan(valBSAS) | valBSAS<=0
errordlg('Wrong Input for parameter BSAS, BSAS must be non zero positive real','Error')
return
end
valMSAS=str2double(get(handles.txtMSAS,'string'));
if isnan(valMSAS) | valMSAS<=0
errordlg('Wrong Input for parameter MSAS, MSAS must be non zero positive real','Error')
return
end
valt=str2double(get(handles.txtt,'string'));
if isnan(valt) | valt<=0
errordlg('Wrong Input for parameter t, t must be non zero positive real','Error')
return
end
valX=str2double(get(handles.txtX,'string'));
if isnan(valX) | valX<=0
errordlg('Wrong Input for parameter X, X must be non zero positive real','Error')
return
end
valSNR=str2double(get(handles.txtSNR,'string'));
valmonBS=str2double(get(handles.txtmonBS,'string'));
if isnan(valmonBS) | valmonBS<=0 | mod(valmonBS,floor(valmonBS))~=0 |valmonBS > valS & get(handles.radiobutton20, 'Value')==1;
errordlg('Wrong Input for the BS antenna to plot, it must be non zero natural smaller or equal to S','Error')
return
elseif isnan(valmonBS) | valmonBS<=0 | mod(valmonBS,floor(valmonBS))~=0 | valmonBS > 2*valS & get(handles.radiobutton20, 'Value')==0;
errordlg('Wrong Input for the BS antenna to plot, it must be non zero natural smaller or equal to 2S','Error')
return
end
valmonMS=str2double(get(handles.txtmonMS,'string'));
if isnan(valmonMS) | valmonMS<=0 | mod(valmonMS,floor(valmonMS))~=0 | valmonMS > valU & get(handles.radiobutton27, 'Value')==1;
errordlg('Wrong Input for the MS antenna to plot, it must be non zero natural smaller or equal to U','Error')
return
elseif isnan(valmonMS) | valmonMS<=0 | mod(valmonMS,floor(valmonMS))~=0 | valmonMS > 2*valU & get(handles.radiobutton27, 'Value')==0
errordlg('Wrong Input for the MS antenna to plot, it must be non zero natural smaller or equal to 2U','Error')
return
end
valpath=str2double(get(handles.txtpath,'string'));
if isnan(valpath) | valpath<=0 | mod(valpath,floor(valpath))~=0 | valpath > valN
errordlg('Wrong Input for the path to plot, it must be non zero natural smaller or equal to N','Error')
return
end
valD=str2double(get(handles.txtD,'string'));
if isnan(valD) | valD<=0 | mod(valD,floor(valD))~=0
errordlg('Wrong Input for D, D must be non zero natural','Error')
return
end
valdrop=str2double(get(handles.txtdrop,'string'));
if isnan(valdrop) | valdrop<=0 | mod(valdrop,floor(valdrop))~=0 | valdrop > valD
errordlg('Wrong Input for drop to plot, it must be non zero natural smaller or equal to D','Error')
return
end
cor=[1 str2double(get(handles.edit50,'string')) str2double(get(handles.edit51,'string')) str2double(get(handles.edit52,'string')) 0 str2double(get(handles.edit53,'string')) str2double(get(handles.edit54,'string')) str2double(get(handles.edit55,'string')) str2double(get(handles.edit56,'string')) str2double(get(handles.edit57,'string'))];
if isnan(cor(2)) | isnan(cor(3)) | isnan(cor(4)) | isnan(cor(6)) |isnan(cor(7)) |isnan(cor(8)) |isnan(cor(9)) |isnan(cor(10))
errordlg('Check the Correlated Parameters','Error')
return
end
ti=valt/(0.001*valX);
k=1;
for k=1:valD
if b==1
[vald valthetaBS valthetaMS valomegaBS valomegaMS valthetav]=OrientationsFixBS(valR);
else
end
d=get(handles.checkbox14, 'Value');%flag for fixed powers and delays
if d==1
A=handles.A;
B=handles.B;
for i=1:valN
pn(i)=10^(str2num(get(handles.A(i),'string'))/10);
tn(i)=str2num(get(handles.B(i),'string'))*10^(-6);
i=i+1;
end
else
pn=zeros(length(valN));
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -