interp
Description
returns interpolated values from the propagation data for each query point specified
in latitude and longitude vectors. The interpolation is performed using a scattered
data interpolation method. Values corresponding to query points outside the data
region are assigned a interpvalue
= interp(pd
,lat
,lon
)NaN
.
returns interpolated values with additional options specified by name-value pair
arguments.interpvalue
= interp(pd
,Name,Value
)
Examples
Transmitter Site Service Areas
Define names and locations of sites around Boston.
names = ["Fenway Park","Faneuil Hall","Bunker Hill Monument"]; lats = [42.3467,42.3598,42.3763]; lons = [-71.0972,-71.0545,-71.0611];
Create array of transmitter sites.
txs = txsite("Name", names,... "Latitude",lats,... "Longitude",lons, ... "TransmitterFrequency",2.5e9);
Compute received power data for each transmitter site.
maxr = 20000; pd1 = coverage(txs(1),"MaxRange",maxr); pd2 = coverage(txs(2),"MaxRange",maxr); pd3 = coverage(txs(3),"MaxRange",maxr);
Compute rectangle containing locations of all data.
locs = [location(pd1); location(pd2); location(pd3)]; [minlatlon, maxlatlon] = bounds(locs);
Create grid of locations over rectangle.
gridlength = 300; latv = linspace(minlatlon(1),maxlatlon(1),gridlength); lonv = linspace(minlatlon(2),maxlatlon(2),gridlength); [lons,lats] = meshgrid(lonv,latv); lats = lats(:); lons = lons(:);
Get data for each transmitter at grid locations using interpolation.
v1 = interp(pd1,lats,lons); v2 = interp(pd2,lats,lons); v3 = interp(pd3,lats,lons);
Create propagation data containing minimum received power values.
minReceivedPower = min([v1 v2 v3],[],2,"includenan"); pd = propagationData(lats,lons,"MinReceivedPower",minReceivedPower);
Plot minimum received power, which shows the weakest signal received from any transmitter site. The area shown may correspond to the service area of triangulation using the three transmitter sites.
sensitivity = -110; contour(pd,"Levels",sensitivity:-5,"Type","power")
Input Arguments
pd
— Propagation data
propagationData
object (default)
Propagation data, specified as a propagationData
object.
lat
— Latitude coordinate values
vector
Latitude coordinate values, specified as a vector in decimal degrees with
reference to Earth's ellipsoid. model WGS-84. The latitude coordinates must
be in the range [-90 90]
.
lon
— Longitude coordinate values
vector
Longitude coordinate values, specified as a vector in decimal degrees with reference to Earth's ellipsoid. model WGS-84.
Name-Value Arguments
Specify optional pairs of arguments as
Name1=Value1,...,NameN=ValueN
, where Name
is
the argument name and Value
is the corresponding value.
Name-value arguments must appear after other arguments, but the order of the
pairs does not matter.
Before R2021a, use commas to separate each name and value, and enclose
Name
in quotes.
Example: 'Method','linear'
DataVariableName
— Data variable to interpolate
character vector | string scalar
Data variable to interpolate, specified as the comma-separated pair
consisting of 'DataVariableName'
and a character
vector or string scalar corresponding to a variable name in the data
table used to create the propagationData
container
object. The default value is the DataVariableName
property in the propagationData
.
Data Types: char
| string
Method
— Method used to interpolate data
'natural'
(default) | 'nearest'
| 'linear'
Method used to interpolate data, specified as the comma separated-pair
consisting 'Method'
and one of the following:
'natural'
- Natural neighbor interpolation'linear'
- Linear interpolation'nearest'
- Nearest neighbor interpolation
Data Types: char
| string
Output Arguments
interpvalue
— Interpolated values from propagation data
numeric vector
Interpolated values from the propagation data for each query point specified in latitude and longitude vectors, returned as a numeric vector.
Version History
Introduced in R2020a
See Also
plot
| contour
| location
| getDataVariable
Abrir ejemplo
Tiene una versión modificada de este ejemplo. ¿Desea abrir este ejemplo con sus modificaciones?
Comando de MATLAB
Ha hecho clic en un enlace que corresponde a este comando de MATLAB:
Ejecute el comando introduciéndolo en la ventana de comandos de MATLAB. Los navegadores web no admiten comandos de MATLAB.
Select a Web Site
Choose a web site 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 web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)