how to write for loop for this case?

1 Ansicht (letzte 30 Tage)
bahareh bshrt
bahareh bshrt am 10 Feb. 2021
Beantwortet: Manash Sahoo am 10 Feb. 2021
I have this relation
deltaT=50;
K_eff=C_E+(teta*deltaT*K_E);
F_eff=(C_E-((1-teta)*deltaT*K_E))*T0+(deltaT*F_e);
T50=K_eff\F_eff;
deltaT=100;
K_eff=C_E+(teta*deltaT*K_E);
F_eff=(C_E-((1-teta)*deltaT*K_E))*T50+(deltaT*F_e);
T100=K_eff\F_eff;
deltaT=150;
K_eff=C_E+(teta*deltaT*K_E);
F_eff=(C_E-((1-teta)*deltaT*K_E))*T100+(deltaT*F_e);
T150=K_eff\F_eff;
can anyone help me to write code for this?(code for deltaT & Tn)

Antworten (1)

Manash Sahoo
Manash Sahoo am 10 Feb. 2021
Could you elaborate on your question? Are you trying to execute this code in the context of a for loop? Additionally, I don't see a variable named "Tn".
But, if your question is how to turn this code into a for loop with 'deltaT' as the iterating variable, try this:
for deltaT = 0:50:150
if deltaT == 0
deltaT = 1;
end
K_eff=C_E+(teta*deltaT*K_E);
F_eff=(C_E-((1-teta)*deltaT*K_E))*T0+(deltaT*F_e);
T50=K_eff\F_eff;
K_eff=C_E+(teta*deltaT*K_E);
F_eff=(C_E-((1-teta)*deltaT*K_E))*T50+(deltaT*F_e);
T100=K_eff\F_eff;
K_eff=C_E+(teta*deltaT*K_E);
F_eff=(C_E-((1-teta)*deltaT*K_E))*T100+(deltaT*F_e);
T150=K_eff\F_eff;
end

Kategorien

Mehr zu Loops and Conditional Statements 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!

Translated by