Help with while loop

4 次查看(过去 30 天)
Hdez
Hdez 2020-11-26
评论: Hdez 2020-12-3
I can't do this while loop properly, someone help me please?
  2 个评论
Rik
Rik 2020-11-26
Why did you delete your previous question? It is the same as this one.
Hdez
Hdez 2020-12-3
Thank you for your help

请先登录,再进行评论。

回答(1 个)

Walter Roberson
Walter Roberson 2020-11-26
dt = input('Enter the desired time step: ');
while dt >= h^2 / (4*alpha)
fprintf('solution is unstable\nPlease enter a value smaller than %g\n', h^2/(4*alpha));
dt = input('Enter the desired time step: ');
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