No BSD License  

Highlights from
Latitude Longitude to KML

from Latitude Longitude to KML by Patrick Robinson
converts lat/lon data to a google-earth file

pwr_kml(name,latlon)
function pwr_kml(name,latlon)
%makes a kml file for use in google earth
%input:  name of track, one matrix containing latitude and longitude
%usage:  pwr_kml('track5',latlon)

header=['<kml xmlns="http://earth.google.com/kml/2.0"><Placemark><description>"' name '"</description><LineString><tessellate>1</tessellate><coordinates>'];
footer='</coordinates></LineString></Placemark></kml>';

fid = fopen([name '.kml'], 'wt');
d=flipud(rot90(fliplr(latlon)));
fprintf(fid, '%s \n',header);
fprintf(fid, '%.6f, %.6f, 0.0 \n', d);
fprintf(fid, '%s', footer);
fclose(fid)

Contact us at files@mathworks.com