how to split a number

2 次查看(过去 30 天)
for eg I have this data from a gps receiver 2829.20246 in which 28 is degree value and 29.20246 is minute value.I want to convert the minute in degree decimal . So how can I seperate and process data.....????

采纳的回答

Bjorn Gustavsson
Bjorn Gustavsson 2019-6-26
Perhaps something like this:
GPSval = 2829.20246;
GPSdeg = sign(GPSval)*floor(abs(GPSval/100));
GPSmin = GPSval - 100*GPSdeg;
Should be stable to negative values.
HTH

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 MATLAB 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by