Clear Filters
Clear Filters

Determining decimal point validation

1 view (last 30 days)
Jay
Jay on 22 Apr 2016
Edited: Jay on 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.

Accepted Answer

Walter Roberson
Walter Roberson on 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

More Answers (0)

Categories

Find more on Environment and Settings in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!