the (if statement) condition happens only ones but I want to repeat this if (F Zero) is still not empty
3 次查看(过去 30 天)
显示 更早的评论
if (~isempty(F_Zero)) %There is Zeros (not empty)
W(:,F_Zero) = []; % Remove the columns of W
HT(F_Zero,:) = []; % Remove the rows of HT
W_bar = W./sqrt(sum(abs(W.^2),1));
D_Matrix = HT*W_bar; %Diagonal Matrix
D_Square = (abs(diag(D_Matrix))').^2; % Channel gains
P = waterfill(Pt,Pn./D_Square);
F_Zero=find(~P);
else
% do Nothing
end
2 个评论
采纳的回答
KSSV
2021-6-8
If you are looking for a loop, you may go for while loop.
while ~isempty(F_Zero)
% Do what you want
end
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Loops and Conditional Statements 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!