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 件のコメント
Mouhamed Niasse
Mouhamed Niasse 2021 年 6 月 8 日
https://www.mathworks.com/help/matlab/ref/while.html?s_tid=srchtitle
Rena Berman
Rena Berman 2021 年 12 月 16 日
(Answers Dev) Restored edit

サインインしてコメントする。

採用された回答

KSSV
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 件)

カテゴリ

Help Center および File ExchangeLoops and Conditional Statements についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by