function [height] = SRTM(coord) lon=[]; lat=[]; path = "/instruct/your/path/to/the/*.hgt/files/here/"; for ii=1:size(coord,1) tmp=coord(ii,1:2); //determine the file name lon(1)=floor(tmp(2)) lon(2)=ceil(tmp(2)) lat(1)=floor(tmp(1)) lat(2)=ceil(tmp(1)) if lon(2)==lon(1) then lon(2) = lon(2)+1;end; if lat(2)==lat(1) then lat(2) = lat(2)+1;end; if lon<=(-100) then LON = "W" elseif lon(1)>(-100)& lon(1)<=(-10) then LON = "W0"; elseif lon(1)>(-10)& lon(1)<0 then LON = "W00"; elseif lon(1)>=0 & lon(1)<10 then LON = "E00"; elseif lon(1)>10 & lon(1)<100 then LON = "E0"; else LON = "E"; end; if lat(1)<=(-10) then LAT = "S"; elseif lat(1)>(-10)& lat(1)<0 then LAT = "S0"; elseif lat(1)>=0 & lat(1)<10 then LAT = "N0"; else LAT = "N"; end; fich = path+LAT+string(abs(lat(1)))+LON+string(abs(lon(1)))+".hgt"; if isempty(ls(fich)) warning(fich +" not found") error("You lack the proper SRTM data for your coordinates") return end //determine the index index(1)=floor((lat(2)-tmp(1))*1201); index(2)=round((tmp(2)-lon(1))*1201); index(3)=1201*index(1)+index(2); fid=mopen(fich,'r'); mseek(2*index(3)) heighti(ii)=mget(1,'usb',fid); height=double(heighti); mclose(fid) end endfunction