?? test.m
字號(hào):
for mobiles = 10:5:50
iterations = 1;
dmin = 200;
R = 1000;
k = 3;
n = 4;
counterinit('outage_counter');
counterset('outage_counter', 0);
for i = 1:iterations;
power_initial = -73 ;
for j = 1:mobiles;
distance = unidrnd (R,1,mobiles)
if distance (j) <= dmin;
power (j) = k* (dmin/R)^n;
else
power (j) = k* (distance (j)/R)^n ;
end
SIR = (10*log10 (power (j)))
SIR_threshold= -14;
SIR_observed = SIR (j)
if SIR_observed < SIR_threshold
counterinc('outage_counter');
end
end
outage_counter = (counterval('outage_counter'))
end
outage_percentage = (( counterval('outage_counter') /mobiles)*100)
% plot(mobiles, outage_percentage);
%title('Outage Probability vs Number of Mobiles - Distance Based Power Control Algorithm')
%xlabel('Number of mobiles in cell')
%ylabel('Percentage of mobiles in outage')
end
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -