Mapping Toolbox | ![]() ![]() |
Regular matrix map from vector data
Syntax
[map,maplegend] = vec2mtx(lat,lon,scale) [map,maplegend] = vec2mtx(lat,lon,scale,latlim,lonlim) [map,maplegend] = vec2mtx(lat,lon,map1,maplegend1) [...] = vec2mtx(...,'filled')
Description
[map,maplegend] = vec2mtx(lat,lon,scale) creates a regular matrix map from vector data. The returned map has values of one corresponding to the vector data, and zeros otherwise. lat
and lon
are vectors of equal length containing geographic locations in units of degrees. The scale factor represents the number of matrix entries per single unit of latitude and longitude (e.g., 10 entries per degree, 100 entries per degree). The scale
input must be scalar.
[map,maplegend] = vec2mtx(lat,lon,scale,latlim,lonlim) uses the two element vector latitude and longitude limits to define the extent of the map. If omitted, the limits are computed automatically.
[map,maplegend] = vec2mtx(lat,lon,map1,maplegend1) uses the provided map
and maplegend
to define the extent of the map. If omitted, the limits are computed automatically.
[...] = vec2mtx(...,'filled') also fills the area outside the border. The interior then has values of 0, the border 1 and the exterior 2. lat
and lon
should contain data that closes on itself
Examples
[lat,long] = extractm(worldlo('POpatch'),'Russia'); [map,maplegend] = vec2mtx(lat,long,2,'filled'); [latlim,lonlim] = limitm(map,maplegend); worldmap(latlim,lonlim,'none'); framem off meshm(map,maplegend) colormap(flag(3))
Limitations
The vec2mtx
function will not fill properly if the vector data extends beyond a pole.
See Also
country2mtx |
Construct a matrix map for a country in the worldlo database |
ltln2val |
Returns map code value associated with positions |
imbedm |
Encodes data points into a regular matrix map |
encodem |
Fills in indexed maps with specified seeds |
interpm |
Interpolates vector data to a specified data separation |
![]() | utmgeoid | vfwdtran | ![]() |