Reads in a simple Google Earth kml into Matlab. If you have bought Google Earth Plus, you can digitize 'paths' (lines). This funcion allows you to load one of these saved paths into Matlab. This code extracts lat,lon and z from a kml file.
Great, but kml document breaks coordinates if there are more than 1000 points.
So in this function you just pick the first 1000 points.
Maybe with another if, you can check if there are a second block of coordinate.
Nice function. I think you could make it much more robust to mis-placed spaces by using "xmlread" and then the W3C XML-handling classes, e.g.:
>> doc = xmlread(fileName);
>> c = doc.getElementsByTagName('coordinates').item(0);
>> coord_str = c.getChildNodes().item(0).getData();