I want to calculate SIR for a Tran in the center of a circle for each interferer distributed randomly in the circle
2 次查看(过去 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
0 个评论
回答(1 个)
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"));
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Creating and Concatenating Matrices 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!