Borrar filtros
Borrar filtros

Determining decimal point validation

1 visualización (últimos 30 días)
Jay
Jay el 22 de Abr. de 2016
Editada: Jay el 23 de Abr. de 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.

Respuesta aceptada

Walter Roberson
Walter Roberson el 22 de Abr. de 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 comentario
Jay
Jay el 23 de Abr. de 2016
Editada: Jay el 23 de Abr. de 2016
Thanks again Walter.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Environment and Settings en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by