Clearing an edit field (numeric) and text area

6 次查看(过去 30 天)
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 :)

回答(1 个)

Cris LaPierre
Cris LaPierre 2020-5-7
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 个评论
William Corluka
William Corluka 2020-5-7
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 2020-5-7
Ah, putting it in quotes makes it text, resulting in the error message you were seeing.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Structures 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by