I want to calculate SIR for a Tran in the center of a circle for each interferer distributed randomly in the circle

조회 수: 1 (최근 30일)
I'm defining SIR_V2V_S as an open 1xn matrix but not getting SIR_V2V_S for each interferer rather getting value of SIR for last interferer only.
SIR_V2V_S=[]
m=0;
for n=1:length(I_dis_v2v)
m=I_dis_v2v(n);
SIR_V2V_S= (P_V.*(r_v.^(-Eta_V)).*Ch_Fading)./((sum((P_V.*hx.*(m.^(-Eta_V)))))+N0);
end

답변 (1개)

Vedant Shah
Vedant Shah 2025년 6월 20일
The Signal-to-Interference Ratio (SIR) needs to be computed for a transmitter (Tx) located at the centre of a circle, with multiple interferers randomly distributed within the circle.
In the provided code, a loop is used to iterate over each interferer, but the variable ‘SIR_V2V_S’ is overwritten in each iteration instead of storing the result for each interferer.
To fix this, the SIR value for each interferer needs to be appended to the SIR_V2V_S array. So, the following line of code
SIR_V2V_S= (P_V.*(r_v.^(-Eta_V)).*Ch_Fading)./((sum((P_V.*hx.*(m.^(-Eta_V)))))+N0);
Should be replaced by:
SIR_V2V_S (end+1) = (P_V.*(r_v.^(-Eta_V)).*Ch_Fading)./((sum((P_V.*hx.*(m.^(-Eta_V)))))+N0);
For more information, please refer to the documentation using the following commands in the MATLAB command line: 
web(fullfile(docroot, " /matlab/ref/end.html"));

카테고리

Help CenterFile Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

제품


릴리스

R2016b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by