how to write values with dms2degrees
显示 更早的评论
what i have to do is insert an excel table where the coordinates are in degrees, minutes and seconds and convert it to decimal degrees.
the table that is I structured in this way:
ellipses_points_x1 ellipses_points_y1 thickness_cm eruptive_center_x0 eruptive_center_y0 eccentricity volume_published_km3
176° 00' 45,8593 38° 51' 42,6182 200 175°59'0.1,9978 38°79'94,3831 0,74 6
176° 02' 57,5069 38° 52' 19,6326 200
176° 06' 04,0076 38° 46' 34,9070 200
176° 02' 57,5069 38° 47' 09,1154 200
175° 56' 11,5936 38° 35' 12,6413 3
175° 59' 43,6924 38° 32' 26,7981 3
data2 = T_elchichon(:,{'ellipses_points_x1'});
angleInDegrees = dms2degrees(data2);
I have to convert all these coordinates to be able to use them to calculate distances. I found the dms2degrees function but in any case if I select for example a column it does not give me the result. the mistake it gives me is
Error using dms2degrees>validateInput (line 63)
DMS input array must be real-valued.
Error in dms2degrees (line 52)
validateInput(dms)
does the excel table have to be prepared in any particular way?Can anyone help me?
thanks
4 个评论
ELISABETTA BILLOTTA
2022-10-31
移动:Star Strider
2022-10-31
It's easy:
Use
v = [176 0 45.8593]
or
vv= "176°00'45.8593""N"
Then
dms2degrees(v)
str2angle(vv)
work.
ELISABETTA BILLOTTA
2022-11-1
Torsten
2022-11-1
I have no experience with reading of string matrices and later conversion to numerical values.
Maybe someone else in the forum can help here.
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Spreadsheets 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!