Code covered by the BSD License  

Highlights from
Google Earth Toolbox

image thumbnail
from Google Earth Toolbox by scott lee davis
Various plotting/drawing functions that can be saved as KML output, and loaded in Google Earth

demo_ge_poly3()
function demo_ge_poly3()

x = linspace(0,20,100); %longitude
e1 = 1e6;   %elevation 1
e2 = 5e6;   %elevation 2
lat = 5;    %latitude

%Polygon coordinates:
X = [x,fliplr(x)];
Y = [ones(size(x))*lat,ones(size(x))*lat];
Z = [ones(size(x))*e1,ones(size(x))*e2];

%Initialize kml string:
kmlStr='';

for j=-180:20:180
    %Shift polygon by j degrees longitude:
    sX = X + j;
    
    kmlStr = [kmlStr,ge_poly3(sX,Y,Z,...
                      'altitudeMode','relativeToGround',...
                       'msgToScreen',true)];
end

ge_output('demo_ge_poly3.kml',kmlStr);

Contact us at files@mathworks.com