This is a part of a code and I want to add something to it, description below
Ältere Kommentare anzeigen
%This is a part of a code and I want to add something to it so instead of Deleting all the Users row from Heff that corresponding to P=0 in each itretion, I want to delete only the first row that corresponding to P=0 in each itretion
do_Water_filling = 1;
while do_Water_filling
W = pinv(Heff'); %Precoding Matrix
W_bar = ((W./sqrt(sum(abs(W.^2),1))));
D_Matrix = Heff'*W_bar; %Diagonal Matrix
D_Square = (abs(diag(D_Matrix))').^2; %Channel Gains
P = waterfill(Pt,Pn./D_Square);
if any(P==0)
Heff(:,P==0) = []; %Delete User Row
else
do_Water_filling = 0;
end
end
5 Kommentare
Rik
am 17 Sep. 2021
Then you shouldn't do Heff(:,P==0) = [];. What have you tried so far to find the first occurence only of P==0?
Awais Saeed
am 17 Sep. 2021
what are the dimensions of your P and Heff? Or type
whos
to get the dimensions
Matthew Worker
am 17 Sep. 2021
Matthew Worker
am 17 Sep. 2021
Rena Berman
am 16 Dez. 2021
(Answers Dev) Restored edit
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Creating and Concatenating Matrices finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!