Visualization of directional data (2D) using arrows.
Draws arrows at locations specified by "X" (longitude) and "Y" (latitude). The direction of each arrow is determined from its components "U" (positive in the direction of positive longitude) and "V" (positive in the direction of positive latitude).
In addition to the above, this syntax also allows for specification of a number of parameters regarding the appearance of the data when viewed in Google Earth. Assigning values to the parameters can be accomplished by inclusion of an alternating sequence of parameters and their value. The table below provides an overview of the authorized options. The order in which the parameters are included does not matter. Please be aware that the options are case-sensitive. Examples are provided further down.
Latitudes on the Southern hemisphere must be passed as negative values. Same for longitudes on the Western hemisphere.
Latitudes and longitudes should be passed in units of decimal degrees (also known as fractional degrees). Google Earth uses Simple Cylindrical projection (also known as Plate Carée) with a WGS84 datum. Altitudes must be passed in meters.
See the demo file demo_ge_quiver for more details.
First, we calculate a surface according to:
res = 0.3;
[X,Y] = meshgrid(-2:res:2);
Z = X.*exp(-X.^2 - Y.^2);
That yields the surface as displayed in the image below.

Next, we calculate the spatial gradient at each point according to MATLAB's gradient() function. Subsequently passing variables "X", "Y", "U", and "V" to ge_quiver() and using ge_output() to generate a kml file...
[U,V] = gradient(Z,res,res);
kmlStr = ge_quiver(X,Y,U,V,...
'lineColor','ffffff00',...
'lineWidth',1.2,...
'altitude',50000,...
'msgToScreen',true);
ge_output('example_ge_quiver.kml',kmlStr);
...will yield the following when viewed in Google Earth:
