How to Replace Equation Inside a For Loop?

I'm trying to integrate a PDE from let's say (50 to 75) inside a for-loop. However, the equation used to integrate for (50 to 65) is slightly different than the one used to integrate for (65 to 75).
My question is, how would I tell matlab to stop using (equation_1) once 65 is reached, and to start using (equation_2)?
Any help would be greatly appreciated :)

 採用された回答

Alan Weiss
Alan Weiss 2019 年 1 月 24 日

1 投票

if t <= 65 % Assume t is your integration variable
% Your code here
else
% Different code here
end
Alan Weiss
MATLAB mathematical toolbox documentation

1 件のコメント

Ismail Elamin
Ismail Elamin 2019 年 1 月 25 日
It worked! Thank you, I really appreciate it :)

サインインしてコメントする。

その他の回答 (0 件)

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by