A problem that arises when performing geographically weighted regression is determining the distance between GPS coordinates. GIS (geographical information system) data is usually reported as a function of latitude and longitude.
A common form of GIS data is a CSV file of latitude, longitude, z triples, where z is some quantity that varies with space.
As a prelude to interpolation, the distance between a given point and every other given point in an area needs to be calculated.
Given a set of GPS coordinates, return the distance (in miles) between each point and every point around it using the haversine formula ( http://en.wikipedia.org/wiki/Haversine_formula ) and taking the radius of Earth to be 3959 miles.
See Test Suite for Examples
Solution Stats
Problem Comments
4 Comments
Solution Comments
Show comments
Loading...
Problem Recent Solvers38
Suggested Problems
-
Find the longest sequence of 1's in a binary sequence.
6800 Solvers
-
Sort a list of complex numbers based on far they are from the origin.
5810 Solvers
-
Check that number is whole number
5413 Solvers
-
2283 Solvers
-
358 Solvers
More from this Author9
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
Test suite needs abs( ).
Updated. Thank you for the feedback
Is the test suite expecting a 19x19 array? Because when I submit my solution with a 19x19 array the test suite fails and I get the message: "Arrays have incompatible sizes for this operation."
The first test suite was not defined for the user. It has been updated now.