MATLAB Answers

2

How to create an empty edit field (numeric) in app designer

Asked by John Cadigan on 5 Apr 2019
Latest activity Commented on by Marc Youcef on 13 Aug 2019
I am writing an app that has a user enter a quantity in a numeric Edit Field. The field starts off with a default value of 0 so that the user has to delete the 0 and then enter the number. Is there a way to get the default to be empty rather than a 0?

  1 Comment

I was searching for same request but apprently there is no way to do that using uinumericeditfield as this edit field forces you to have at list a numeric value. Which is a pain when you do not want the user to necessarly enter something in, you get a 0 value instead of empty field...

Sign in to comment.

1 Answer

Answer by Chris
on 13 Aug 2019

Can you make the input a text field and reject anything that does not convert to a number?

  1 Comment

Yes, this is the only solution I thought about. Unfortunately in my case I was trying to take advantage of the 'uinumericeditfield' functionnality which is doing exactly this for you and wanted to simply add an 'empty by default' option.

Sign in to comment.