its giving an error : Undefined function 'Length' for input arguments of type 'double'.
Show older comments
d= [10 30 60 100 500 800];
L_wallsdB =12; % Penetration
Gmax=16; % gain
Gs=20; % sidelobe gain
Gt=Gmax-Gs;
% Macropower i and Femtopwer j, Pj=Tx power of femto, % in mW
Macropower=2000;
Femtopower=100;
mpdb=10*log10(Macropower); % in dB
fpdb=10*log10(Femtopower); % in dB
no_of_macro=50;
no_of_femto=100;
wdb=2; % penetrantion in dB
for i=1:Length(d);
fprdb(d)=fpdb+Gt-(38.5+20*log10(d(i)));
mprdb(d)=mpdb+Gt-(28+35*log10(d(i)));
end
fpr=10.^(fprdb./10);
mpr=10.^(mprdb./10);
w=10.^(wdb./10);
k=0:20:200;
for i=1:1:length(k);
num(i)=mpr(3)+(Macropower-mpr(3)*0.1);
den(i)=no_of_macro*mpr(5)+k(i)*fpr(1)+0.01;
sir(i)=num(i)./den(i);
end
tp=3.84*log2(1+0.5*sir);
figure; plot(k,tp); hold on;
plot(k,tp,'ro')
axis tight;
grid on;
xlabel('number of femtocells');
ylabel('number of macrocells');
title('analyzing throghput ');
Answers (1)
madhan ravi
on 28 Jan 2019
Edited: madhan ravi
on 28 Jan 2019
for i=1:length(d);
% ^------- should be lowercase
Note: Preallocate your variables .
Gives:

Categories
Find more on Bar Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!