Hello, I'm making a KML file using the code found on this page: http://www.mathworks.com/help/toolbox/map/ref/kmlwrite.html.
But I have to grab the longitude and latitude on a .ndk file, and I'm not sure how to incorporate that into my script.
This is what I have so far. I know the .ndk part is right, but I don't know how to stick it back into the code that creates the kml. Sorry ahead of time; I'm a total noob.
inputFilename = 'M:\week2\may11.ndk';
inputFile = fopen(inputFilename);
while (feof(inputFile) == 0)
% Read input file in blocks of 5
for i = 1:numLinesInBlock
% Read line from input file
currentLine = fgetl(inputFile);
% If we have the first line, then process it
if (i == 1)
% Extract the information we need
lat = strtrim( currentLine(28:33) );
lon = strtrim( currentLine(35:41) );
elseif (i == 2)
CMT_ID = strtrim( currentLine(1:16) );
filename = 'M:\week2\week2.kml';
kmlwrite(filename, lat, lon, 'Name,' CMT_ID);