Linear interpolation function. |
||
Syntax |
New_y = LinInterp(Old_x, Old_y, New_x, Option) |
|
Arguments |
Name |
Description |
Old_x |
A vector of the x data of the curve to be interpolated. |
|
Old_y |
A vector of the y data of the curve to be interpolated. |
|
New_x |
A vector containing x values for which new y values are to be calculated. |
|
Option optional) |
Set to "extrap" to allow extrapolation when values of New_x are beyond the range of Old_x. The default is "noextrap." |
|
Outputs |
Name |
Description |
New_y |
A vector of the new y values at the given new x values. |
|
Example |
For a given pair of data vectors, find the linear interpolation at new locations |
|
Syntax |
||
y = LinInterp([1,2,3,4],[2,8,18,32] ,[1.1,3.2]) |
||
Results |
||
y = 2.6 20.8 |
||
See Also: |