error in for loop

2 visualizzazioni (ultimi 30 giorni)
Aleksandra Ksiezyk
Aleksandra Ksiezyk il 24 Gen 2020
Risposto: KALYAN ACHARJYA il 24 Gen 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 Commento
KALYAN ACHARJYA
KALYAN ACHARJYA il 24 Gen 2020
Modificato: KALYAN ACHARJYA il 24 Gen 2020
Is there any coding error? if yes, which line?

Accedi per commentare.

Risposta accettata

KALYAN ACHARJYA
KALYAN ACHARJYA il 24 Gen 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

Più risposte (1)

Aleksandra Ksiezyk
Aleksandra Ksiezyk il 24 Gen 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".

Categorie

Scopri di più su Loops and Conditional Statements in Help Center e File Exchange

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by