how to change a 9 digit number to longitude?

18 ビュー (過去 30 日間)
Adhivesh Khandelwal
Adhivesh Khandelwal 2019 年 11 月 15 日
回答済み: Nicolas B. 2019 年 11 月 15 日
hi,
i am supposed to plot latitude and longitude for the given data but longitude and latitude are given as 9-digit numbers and 8-digit numbers respectively. for example;
longitude 127065072 and latitude 37479232. i have a complete table filled with these kind of longitudes and latitudes. can anyone help me understand how to change these numbers to DMS and decimal degress for the whole table?
  1 件のコメント
Rik
Rik 2019 年 11 月 15 日
My guess would be that it already is a decimal degree, but without the decimal point. Does your data make sense to you if you divide these numbers by a million?

サインインしてコメントする。

回答 (1 件)

Nicolas B.
Nicolas B. 2019 年 11 月 15 日
I don't see any "simple" method. I would recommand you to use the following idea:
% get each digit in char array
digits = dec2base(myNumber, 10) - '0'
% reconstruct degrees, second... (in char)
% transform back in numbers
degree = str2double(degree_char)
...
I don't know how works the longitude and latitude description. So I cannot help you more but you have the basic idea.

カテゴリ

Help Center および File ExchangeGeographic Plots についてさらに検索

製品


リリース

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by