Input value in Edit text in MATLAB GUI

Hi,
I am building an APP in MATLAb gui. I have created a edit text box. The box accepts positive values . However when i put 5-2 the edit text box accepts this as 3 value. i want to remove this and ensure edit text box only accepts postive values as 3 and not 5-2. How to do that
Thank you

Respuestas (1)

Walter Roberson
Walter Roberson el 13 de Oct. de 2019

0 votos

Use str2double() instead of str2num() .

Categorías

Más información sobre Data Type Conversion en Centro de ayuda y File Exchange.

Preguntada:

el 5 de Abr. de 2019

Respondida:

el 13 de Oct. de 2019

Community Treasure Hunt

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

Start Hunting!

Translated by