Effacer les filtres
Effacer les filtres

Clearing an edit field (numeric) and text area

8 vues (au cours des 30 derniers jours)
William Corluka
William Corluka le 7 Mai 2020
Commenté : Cris LaPierre le 7 Mai 2020
Hey guys,
Just a quick question about how to clear a numeric edit field. Ive tried using the following code to clear both a numeric edit feild and text area. This code doesnt work as an error pops up saying the 'Value' must be double scalar
Thanks :)

Réponses (1)

Cris LaPierre
Cris LaPierre le 7 Mai 2020
A numeric edit field cannot be blank. You can read more about the value properties of this component here.
MATLAB rejects the value if:
  • The value is NaN, blank, or a complex number.
  4 commentaires
William Corluka
William Corluka le 7 Mai 2020
Perfect, I did try that beforehand but with the 0 inbetween the ' ' marks, and it seemed to reject the whole button press.
Thanks again Cris!
Cris LaPierre
Cris LaPierre le 7 Mai 2020
Ah, putting it in quotes makes it text, resulting in the error message you were seeing.

Connectez-vous pour commenter.

Catégories

En savoir plus sur Environment and Settings dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by