error in for loop
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Aleksandra Ksiezyk
le 24 Jan 2020
Réponse apportée : KALYAN ACHARJYA
le 24 Jan 2020
HALLO !
i am getting an error from my for loop.. Could anyone help me where i am making miskates ?
i have two possibilities T_43 is 1 or 2 - other do not exist.
inside T_43 = 2 there is two possibiliteies where FC_in < 0.5 or FC_in >= 0.5
inside T_43 = 1( beside partitioning this column by FC_in, like in T_43=2) i need to additionally divide them into 3 parts depending on V_H_WS.
thx
if T_43 == 1
% Radiator V_H_WS = 0
if V_H_WS == 0 && FC_in < 0.5
f_pl = 0.588 ;
elseif V_H_WS == 0 && FC_in >= 0.5
f_pl = 0.588+0.822.*(FC-0.5) ;
% Radiator 0 < V_H_WS < 30*P_WP_KN
elseif V_H_WS > 0 && V_H_WS < 30*P_WP_KN && FC_in < 0.5
f_pl = 0.588+0.01*(V_H_WS./P_WP_KN) ;
elseif V_H_WS > 0 && V_H_WS < 30*P_WP_KN && FC_in >= 0.5
f_pl = 0.177+0.02*(V_H_WS./P_WP_KN)-0.02*FC ;
% Radiator V_H_WS >= 30*P_WP_KN
elseif V_H_WS >= 30*P_WP_KN && FC_in < 0.5
f_pl = 0.888 ;
elseif V_H_WS >= 30*P_WP_KN && FC_in >= 0.5
f_pl = 0.888+0.222*(FC-0.5) ;
else
error('error !')
end
elseif T_43 == 2
% flow heating
if FC_in < 0.5
f_pl = 0.974;
elseif
f_pl = 0.974+0.05.*(FC-0.5);
else
error('error !')
end
else
error('error !')
end
end
1 commentaire
KALYAN ACHARJYA
le 24 Jan 2020
Modifié(e) : KALYAN ACHARJYA
le 24 Jan 2020
Is there any coding error? if yes, which line?
Réponse acceptée
KALYAN ACHARJYA
le 24 Jan 2020
if T_43 == 1
% Radiator V_H_WS = 0
if V_H_WS == 0 && FC_in < 0.5
f_pl = 0.588 ;
elseif V_H_WS == 0 && FC_in >= 0.5
f_pl = 0.588+0.822.*(FC-0.5) ;
% Radiator 0 < V_H_WS < 30*P_WP_KN
elseif V_H_WS > 0 && V_H_WS < 30*P_WP_KN && FC_in < 0.5
f_pl = 0.588+0.01*(V_H_WS./P_WP_KN) ;
elseif V_H_WS > 0 && V_H_WS < 30*P_WP_KN && FC_in >= 0.5
f_pl = 0.177+0.02*(V_H_WS./P_WP_KN)-0.02*FC ;
% Radiator V_H_WS >= 30*P_WP_KN
elseif V_H_WS >= 30*P_WP_KN && FC_in < 0.5
f_pl = 0.888 ;
elseif V_H_WS >= 30*P_WP_KN && FC_in >= 0.5
f_pl = 0.888+0.222*(FC-0.5) ;
else
error('error !')
end
elseif T_43 == 2
% flow heating
if FC_in < 0.5
f_pl = 0.974;
elseif
f_pl = 0.974+0.05.*(FC-0.5);
else
error('error !')
end
else
error('error !')
end
0 commentaires
Plus de réponses (1)
Voir également
Catégories
En savoir plus sur Language Fundamentals dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!