error in for loop

2 次查看(过去 30 天)
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 个评论
KALYAN ACHARJYA
KALYAN ACHARJYA 2020-1-24
编辑:KALYAN ACHARJYA 2020-1-24
Is there any coding error? if yes, which line?

请先登录,再进行评论。

采纳的回答

KALYAN ACHARJYA
KALYAN ACHARJYA 2020-1-24
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

更多回答(1 个)

Aleksandra Ksiezyk
Aleksandra Ksiezyk 2020-1-24
o ma.a... my mistake, too many ends..
but thx for respond
Error: File: Tabelle_43.m Line: 52 Column: 1
Illegal use of reserved keyword "end".

类别

Help CenterFile Exchange 中查找有关 Loops and Conditional Statements 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by