MATLAB: Received Power Vs Distance

@aj

Hi Everyone;
My MATLAB code result in the received power increases with distance as shown in the figure in spite I use Friis formula. Where is my mistake.
Pr=Pt*Gt*Gr*lambda^2./16*pi^2.*(Z).^2; %Friis Formula

Best Answer

If Z is distance then you should probably have
Pr=Pt*Gt*Gr*lambda^2./(16*pi^2.*Z.^2);
Note the position of the parentheses. In your version Z is on the numerator.