MATLAB Answers

0

Error in converting Decimals from Degree Minutes Seconds

Asked by Ahsan Abbas on 2 Apr 2016
Latest activity Commented on by Ahsan Abbas on 2 Apr 2016
Hello, I am facing problem in converting dms to dd, i have a matrix of 4x3 as shown below
i am using following command to convert in degree decimals,
angleInDegrees = dms2degrees(dms)
but i always got following error:
Need assistance ?

  0 Comments

Sign in to comment.

2 Answers

Answer by Walter Roberson
on 2 Apr 2016
 Accepted Answer

dms2degrees([dms(:,1), floor(dms(:,2)), mod(dms(:,2),1)*60])

  1 Comment

Sign in to comment.


Answer by Azzi Abdelmalek
on 2 Apr 2016

v=[33 31.15 0] % 31.15 is not allowed by Matlab, it should be an integer
out=dms2degrees(fix([33 33.15 0]))

  1 Comment

Sign in to comment.