MATLAB Examples

Identify line or patch segments once they have been combined into large NaN-clipped vectors. You can separate these polygon or line vectors into their component segments using the

Analyze the results of logical grid manipulations to determine the area satisfying one or more conditions (either coded as 1s or an expression that yields a logical value of 1). The areamat

Combine raster data and vector data on the same map.

To define a geolocated data grid, you must define three variables: a matrix of indices or values assocaited with th mapped region, a matrix giving cell-by-cell latitude coordinates, and a

Link line segments into polygons using the polymerge function. polymerge links sets of line segments together by concatenating segments that have matching endpoints. An end point can be

Use the docid:map_ref.f12-569586 function to generate a buffer zone internal to a land area polygon. For more information about this topic, see docid:map_ug.f7-6413 .

Trim vectors to form lines and polygons using the maptriml and maptrimp functions. It is not unusual for vector data to extend beyond the geographic region currently of interest. For

Before making a large, memory-taxing data grid, you should first determine what its size will be. If you know the latitude and longitude limits of a region, you can calculate the size of the

Convert vector data to raster data using the docid:map_ref.f15-424086 function. The example uses patch data for Indiana from the usastatehi shapefile. For more information, see

Overlay polygons using set logic. The docid:map_ref.bve9g51-1 function can perform standard set operations, such as intersection, union, subtraction, and exclusive OR, on two sets of

Remove longitude coordinate discontinuities at date line crossings that can confuse set operations on polygons. This can happen when points with longitudes near 180 degrees connect to

Compute an elevation profile along a straight line using the mapprofile function. Calculating data values along a path is a common application when working with gridded geodata. For

Display vector map data and examine vector data values.

Interpolate values in a set of vertices using the interpm function. In this example, you specify that no gap greater than 1 degree should exist between existing vertices, as specified by the

Calculate the intersections of arbitrary vector data, such as polylines or polygons, using the polyxpoly function.

Simplify polygon and line data using the docid:map_ref.f14-376605 function. Simplifying polygon and line data can speed up certain calculations without making any noticeable impact on

Generate a shaded relief map using raster data, also known as a data grid. Note that the content, symbolization, and the projection of the map are completely independent. The structure and

Compute the gradient, slope, and aspect for a regular data grid. The gradient components are the change in the grid variable per meter of distance in the north and east directions. Slope is

Interpolate coordinates at specific locations using intrplat and intrplon functions. intrplat and intrplon return one value at a time and give you control over the interpolation method

Choose your country to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .

You can also select a location from the following list:

See all countries