error in for loop

1 visualización (últimos 30 días)
Aleksandra Ksiezyk
Aleksandra Ksiezyk el 24 de En. de 2020
Respondida: KALYAN ACHARJYA el 24 de En. de 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 comentario
KALYAN ACHARJYA
KALYAN ACHARJYA el 24 de En. de 2020
Editada: KALYAN ACHARJYA el 24 de En. de 2020
Is there any coding error? if yes, which line?

Iniciar sesión para comentar.

Respuesta aceptada

KALYAN ACHARJYA
KALYAN ACHARJYA el 24 de En. de 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

Más respuestas (1)

Aleksandra Ksiezyk
Aleksandra Ksiezyk el 24 de En. de 2020
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".

Categorías

Más información sobre Loops and Conditional Statements en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by