Effacer les filtres
Effacer les filtres

Determining decimal point validation

1 vue (au cours des 30 derniers jours)
Jay
Jay le 22 Avr 2016
Modifié(e) : Jay le 23 Avr 2016
I have a editbox in a GUI created in Guide.
The type of input will be D.MMSS.
I want to be able to determine if the value inputted is valid.
I.e. The D value to be 0 <= D <= 360, the MM to be 0 <= MM <= 60 and the SS to be 0 <= MM <= 60 .
How do I specify the decimal placements to be analysed?
I.e. the first two decimal places to be analysed using the specified limits and then the 3rd and 4th decimal places to be analysed?
I realise that it would be easier to have 3 drop boxes with the values restricted (one for degrees, one for minutes and one for seconds), but I simply don't have enough room on my GUI with the proceeding input boxes.

Réponse acceptée

Walter Roberson
Walter Roberson le 22 Avr 2016
strsplit() with '.' to get the D. The first two characters in the second fragment are the MM. Whatever is left in the second fragment is the S
  1 commentaire
Jay
Jay le 23 Avr 2016
Modifié(e) : Jay le 23 Avr 2016
Thanks again Walter.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

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

Community Treasure Hunt

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

Start Hunting!

Translated by