필터 지우기
필터 지우기

Determining decimal point validation

조회 수: 1 (최근 30일)
Jay
Jay 2016년 4월 22일
편집: Jay 2016년 4월 23일
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.

채택된 답변

Walter Roberson
Walter Roberson 2016년 4월 22일
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
Jay
Jay 2016년 4월 23일
편집: Jay 2016년 4월 23일
Thanks again Walter.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Environment and Settings에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by