function edit21_CreateFcn(hObject, eventdata, handles)
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
function edit22_Callback(hObject, eventdata, handles)
function edit22_CreateFcn(hObject, eventdata, handles)
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
function popupmenu1_Callback(hObject, eventdata, handles)
contents = get(hObject,'Value');
global n
switch contents
case 1
n=1;
case 2
n = 2;
case 3
n = 4;
end
function popupmenu1_CreateFcn(hObject, eventdata, handles)
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
function radiobutton5_Callback(hObject, eventdata, handles)
global tipcan
if get (handles.radiobutton5,'value') == 1
set(handles.radiobutton6,'value',0);
set(handles.uipanel13,'visible','off');
set(handles.uipanel12,'visible','on');
tipcan=2;
end
function radiobutton6_Callback(hObject, eventdata, handles)
global tipcan
if get (handles.radiobutton6,'value') == 1
set(handles.radiobutton5,'value',0);
set(handles.uipanel13,'visible','on');
set(handles.uipanel12,'visible','off');
tipcan=1;
end
function listbox6_Callback(hObject, eventdata, handles)
global Tm
contents = get(hObject,'Value');
switch contents
case 1
Tm=1;
case 2
Tm = 2;
case 3
Tm = 3;
case 4
Tm = 4;
case 5
Tm = 5;
otherwise
end
function listbox6_CreateFcn(hObject, eventdata, handles)
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
function listbox7_Callback(hObject, eventdata, handles)
global kan
contents = get(hObject,'Value');
switch contents
case 1
kan=2;
case 2
kan = 1;
otherwise
end
function listbox7_CreateFcn(hObject, eventdata, handles)
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
function listbox10_Callback(hObject, eventdata, handles)
global Sez
contents = get(hObject,'Value');
switch contents
case 1
Sez=1;
case 2
Sez = 2;
case 3
Sez = 3;
otherwise
end
function listbox10_CreateFcn(hObject, eventdata, handles)
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
function listbox11_Callback(hObject, eventdata, handles)
global Tp
contents = get(hObject,'Value');
switch contents
case 1
Tp=1;
case 2
Tp = 2;
case 3
Tp = 3;
case 4
Tp = 4;
otherwise
end
function listbox11_CreateFcn(hObject, eventdata, handles)
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
function pushbutton1_Callback(hObject, eventdata, handles)
global Pvh1vt
global Lm1z
global Pvh1med
global L2z
global L2
global Pvh2
global h02
global Zap2
global h0t1
global Lz
global h01
global L1
global Zap1
global Rpred
global Lbz
global L0
global Lmz
global Pvh2medvt
global tipcan
global n
global TIPp
global Tm
global kan
global Sez
global Tp
global L0r
global L2med
global Pvh2vt
global m
global h0t2
global Pcht1
global Nk
global Pch2
global Lk
f = str2num(char(get(handles.edit1,'String')))
P=str2num(char(get(handles.edit2,'String'))); Pfr=str2double(char(get(handles.edit3,'String')));
Gr=str2num(char(get(handles.edit4,'String')));
a=str2double(char(get(handles.edit5,'String')));
h=str2num(char(get(handles.edit6,'String')));
Ugr=str2num(char(get(handles.edit7,'String')));
Fe=str2double(char(get(handles.edit8,'String')));
Pfp=str2double(char(get(handles.edit9,'String')));
Gp=str2num(char(get(handles.edit10,'String')));
Ugp=str2num(char(get(handles.edit13,'String')));
dfk=str2num(char(get(handles.edit22,'String')));
nk=str2num(char(get(handles.edit21,'String')));
m=str2num(char(get(handles.edit23,'String')));
V=str2num(char(get(handles.edit24,'String')));
R=150;
dF=40;
Fk=nk*3100-1250;
Po=1e-4;
Tpr=99.0;
if Sez==1
disp('Введите климатические потери для района работы радиолинии в соответствии с картой')
Lk=str2num(char(get(handles.edit14,'String'))) ;
elseif Sez==2
Lk=str2num(char(get(handles.edit14,'String')));
end
l=30000/f; L0=22+20*log10(R*1e5/l);
L0r=22+20*log10(R*1e5/l)-Gr-Gp-Pfr-Pfp; disp(['L0r=', num2str(L0r),' дБ (потери в свободном пространстве при реальных антеннах)']);
Lmed=62.92*exp(-((l+18.19)/174)^2)+(0.07608*l^(-0.4984)+0.06596)*R; sig=5.116*exp(-((R-205.7)/577.5)^2);
if Sez==2
Lmed=Lmed-12;
sig=4.676*exp(-((R-124.9)/332.4)^2)+3.165*exp(-((R-382)/508.3)^2);
elseif Sez==3
Lmed=Lmed-6;
sig=6.118*exp(-((R-158.6)/547.8)^2); end
if tipcan==2
[Lbz]=Lbzam(Tpr,n);
sig1=0.177*exp(0.2585*sig)-23.48*exp(-0.2856*sig); F=0;
for x=0:0.5:30;
F=1/2+1/2*erf(log(10^(x/20))/(10^(sig1/20)));
if F>=Tpr/100
break;
end
end
Lmz=x;
Lz=Lbz+Lmz;
if Tm==1
B=10*log10(-4/n*log(2^n*Po
elseif Tm==2
B=10*log10(-2/n*log(2^n*Po));
elseif Tm==3 || Tm==4 || Tm==5
B=10*log10(-1/n*log(2^n*Po));
end
disp(['Lbz=', num2str(Lbz),' дБ (потери от быстрых замираний)']);
disp(['Lmz=', num2str(Lmz),' дБ (потери от медленных замираний)']);
elseif tipcan==1
B=35;
if sig<3
sig=3;
elseif sig>7
sig=7;
end
sigma=fix(sig);
[ Lz1 ] = Lzam(Tpr, n, sigma);
sigma=fix(sig)+1;
if sigma>7
Lz2=Lz1;
else
[ Lz2 ] = Lzam(Tpr, n, sigma);
end
sigdr=sig-fix(sig);
Lz=Lz1+(Lz2-Lz1)*sigdr;
end
disp(['Lz=', num2str(Lz),' дБ (потери от медленных и быстрых замираний)']);
delta=Ugr+Ugp+0.056*sqrt(h);
if abs(R-300)<abs(R-250)
R1=300;
elseif abs(R-250)<abs(R-200)
R1=250;
elseif abs(R-200)<abs(R-150)
R1=200;
elseif abs(R-150)<abs(R-100)
R1=150;
else
R1=100;
end
if R1==100
a1=10.09;
b1=0.2266;
c1=-10.33;
d1=-1.994;
elseif R1==150
a1=9.399;
b1=0.1913;
c1=-9.604;
d1=-1.576;
elseif R1==200
a1=7.04;
b1=0.2457;
c1=-7.011;
d1=-1.612;
elseif R1==250
a1=7.807;
b1=0.1683;
c1=-7.757;
d1=-1.013;
elseif R1==300
a1=7.073;
b1=0.2235;
c1=-7.159;
d1=-1.404;
end
Lp=a1*exp(b1*delta)+c1*exp(d1*delta);
X=h*100/l;
if X<12
if abs(R-400)<abs(R-300)
R2=400;
elseif abs(R-300)<abs(R-200)
R2=300;
elseif abs(R-200)<abs(R-150)
R2=200;
elseif abs(R-150)<abs(R-100)
R2=150;
else
R2=100;
end
if R2==100
a1=1.983e15;
b1=-54.05;
c1=9.514;
a2=18.74;
b2=-6.452;
c2=11.95;
elseif R2==150
a1=1.661e15;