while loop multiple conditions

2 ビュー (過去 30 日間)
Riccardo Milani
Riccardo Milani 2019 年 12 月 3 日
編集済み: Bhaskar R 2019 年 12 月 3 日
Hi,
I'm performing a while loop to recreate iterative cycles so as input conditions I have 2 vectors of N elements each one and I cannot convert them into logical.
My while cycle must work until ALL conditions inside my vectors are satisfied.
Here some lines from my script:

回答 (1 件)

Bhaskar R
Bhaskar R 2019 年 12 月 3 日
編集済み: Bhaskar R 2019 年 12 月 3 日
eps=ones(1,n_windings)*0.01;
T_WATERback=ones(1,n_windings)*T_water_hp;
T_WATERfront=T_WATER;
T_WIREback=ones(1,n_windings)*(180+273.15);
T_WIREfront=T_mean;
iteration=0;
% i split the condition as two parts
cond_1 = sum(abs(T_WATERfront-T_WATERback)>eps) == length(T_WATERfront)
cond_2 = sum(abs(T_WIREfront-T_WIREback)>eps) == length(T_WIREfront);
while (cond_1 || cond_2)
end

カテゴリ

Help Center および File ExchangeOperating on Diagonal Matrices についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by