Using clc in my simple scipt prevents user input question being displayed

1 vue (au cours des 30 derniers jours)
Nick
Nick le 14 Jan 2025
Commenté : Cris LaPierre le 15 Jan 2025
I wrote a simple script to ask for a user's age
age = input('What is your age?....')
This works as expected.
However, if I insert a clc in front of this in the code, it does not display the question to the user in the command window. I don't know what is happening here.
Any thoughts?
Thanks
Nick

Réponse acceptée

Voss
Voss le 14 Jan 2025
The behavior you describe happens for me only in MATLAB Online. You can include a short pause after clc to get the input prompt to show up, e.g.:
clc
pause(0.1)
age = input('What is your age?....')
  3 commentaires
Voss
Voss le 14 Jan 2025
You're welcome!
Cris LaPierre
Cris LaPierre le 15 Jan 2025
I see this has already been reported internally.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Programming dans Help Center et File Exchange

Tags

Produits


Version

R2024b

Community Treasure Hunt

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

Start Hunting!

Translated by