Why isn't my while loop terminating?
Mostrar comentarios más antiguos
I am completing a project for a class, and one of the tasks is to get an input from a user, and if a specific input is not given, to keep asking until the user types in the correct input. However, my while loop doesn't terminate even after I give the correct input. Can someone help?
Respuestas (1)
The termination condition of the while loop depends on windowLength, but nothing inside the while loop makes any modifications to windowLength. Possibly you meant to have,
windowLength=input('....')
4 comentarios
Kashish Kashish
el 18 de Abr. de 2022
Matt J
el 18 de Abr. de 2022
You're welcome, but please Accept-click to indicate that the answer is applicable to your question.
Image Analyst
el 18 de Abr. de 2022
@Kashish Kashish Please click the "Accept this answer" link to award Matt "Reputation Points".
Hey @Matt J did you also get a copy of the Mind Reading Toolbox? Or has the question been changed since you answered?
Matt J
el 18 de Abr. de 2022
@Image Analyst The OP removed a screenshot of the code. Hopefully, he will restore it.
Categorías
Más información sobre Loops and Conditional Statements en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!