Help with while loop

1 view (last 30 days)
Hdez
Hdez on 26 Nov 2020
Commented: Hdez on 3 Dec 2020
I can't do this while loop properly, someone help me please?
  2 Comments
Rik
Rik on 26 Nov 2020
Why did you delete your previous question? It is the same as this one.
Hdez
Hdez on 3 Dec 2020
Thank you for your help

Sign in to comment.

Answers (1)

Walter Roberson
Walter Roberson on 26 Nov 2020
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

Categories

Find more on Loops and Conditional Statements in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!