Calculating Change in 1 dimensional array
4 ビュー (過去 30 日間)
古いコメントを表示
Hello! I have a 1 dimensional array of latitude values (which has dimensions of 1 X 224). How would I calculate the change in latitude, aka delta latitude?
Thank you so much!
0 件のコメント
採用された回答
Star Strider
2014 年 8 月 22 日
If they are decimal values, use the diff function. Otherwise, you will have to convert them into decimal values (from degrees-minutes-seconds) first.
2 件のコメント
その他の回答 (2 件)
Image Analyst
2014 年 8 月 22 日
Subtract the two latitudes you want to calculate the difference between? Or am I missing something?
2 件のコメント
Image Analyst
2014 年 8 月 22 日
That's what diff() does. Just make sure your angles are in decimal degrees or radians and not some kind of funky degrees/minutes/arcseconds form.
Stephanie Goldstein
2014 年 8 月 22 日
4 件のコメント
Star Strider
2014 年 8 月 22 日
編集済み: Star Strider
2014 年 8 月 22 日
According to the online documentation, the Mapping Toolbox has the dms2degrees function that does the same thing. I suggest you use it instead of the one I provided. (I don’t have the Mapping Toolbox, so just now thought to look.)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!