error in for loop
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Aleksandra Ksiezyk
am 24 Jan. 2020
Beantwortet: KALYAN ACHARJYA
am 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 Kommentar
KALYAN ACHARJYA
am 24 Jan. 2020
Bearbeitet: KALYAN ACHARJYA
am 24 Jan. 2020
Is there any coding error? if yes, which line?
Akzeptierte Antwort
KALYAN ACHARJYA
am 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 Kommentare
Weitere Antworten (1)
Siehe auch
Kategorien
Mehr zu Language Fundamentals finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!