Clearing an edit field (numeric) and text area
古いコメントを表示
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
2020 年 5 月 7 日
0 投票
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
2020 年 5 月 7 日
Cris LaPierre
2020 年 5 月 7 日
Yes, and currently you are trying to set it to be blank, hence the error message. You must set the Value to a number. Try changing it to this
app.InputvalueEditField.Value = 0;
William Corluka
2020 年 5 月 7 日
Cris LaPierre
2020 年 5 月 7 日
Ah, putting it in quotes makes it text, resulting in the error message you were seeing.
カテゴリ
ヘルプ センター および File Exchange で Whos についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!