Filter löschen
Filter löschen

Determining decimal point validation

1 Ansicht (letzte 30 Tage)
Jay
Jay am 22 Apr. 2016
Bearbeitet: Jay am 23 Apr. 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.

Akzeptierte Antwort

Walter Roberson
Walter Roberson am 22 Apr. 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 Kommentar
Jay
Jay am 23 Apr. 2016
Bearbeitet: Jay am 23 Apr. 2016
Thanks again Walter.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Environment and Settings finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by