interp1gap

버전 1.4.1 (337 KB) 작성자: Chad Greene
Interpolate over small gaps in x, but not over large gaps in x.
다운로드 수: 1.7K
업데이트 날짜: 2019/5/20

라이선스 보기

Sometimes your 1D data has gaps. This may be due to a faulty sensor or irregular sampling intervals. When this is the case, you may want to interpolate over short gaps in your data, but where no data exist for long periods of time, it's inappropriate to interpolate. This function performs interpolation over small gaps in 1D data.

Syntax
vq = interp1gap(v)
vq = interp1gap(x,v,xq)
vq = interp1gap(...,maxgapval)
vq = interp1gap(...,'method')
vq = interp1gap(...,'interpval',vval)
vq = interp1gap(...,'extrap',extrapval)

Description
vq = interp1gap(v) linearly interpolates to give undefined (NaN) values of v.

vq = interp1gap(x,v,xq) interpolates to find vq, the values of the underlying function v at the points in the vector or array xq.

vq = interp1gap(...,maxgapval) specifies a maximum gap in the independent variable over which to interpolate. If x and xq are given, units of maxgapval match the units of x. If x and xq are not provided, units of maxgapval are indices of v, assuming any gaps in v are represented by NaN. If maxgapval is not declared, interp1gap will interpolate over infitely-large gaps.

vq = interp1gap(...,'method') specifies a method of interpolation. Default method is 'linear', but can be any of the following:

'nearest' nearest neighbor interpolation
'linear' linear interpolation (default)
'spline' cubic spline interpolation
'pchip' piecewise cubic Hermite interpolation
'cubic' (same as 'pchip')
'v5cubic' Cubic interpolation used in MATLAB 5.
'next' next neighbor interpolation (Matlab R2014b or later)
'previous' previous neighbor interpolation (Matlab R2014b or later)

vq = interp1gap(...,'interpval',vval) specifies a value with which to replace vq elements corresponding to large gaps. Default is NaN.

vq = interp1gap(...,'extrap',extrapval) returns the scalar extrapval for out-of-range values. NaN and 0 are often used for extrapval.

인용 양식

Chad Greene (2024). interp1gap (https://www.mathworks.com/matlabcentral/fileexchange/45842-interp1gap), MATLAB Central File Exchange. 검색 날짜: .

MATLAB 릴리스 호환 정보
개발 환경: R2012b
모든 릴리스와 호환
플랫폼 호환성
Windows macOS Linux
카테고리
Help CenterMATLAB Answers에서 Interpolation에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

interp1gap

버전 게시됨 릴리스 정보
1.4.1

Added live scripts

1.4.0.0

Inclusion of zip file.

1.3.0.0

Now accepts extrapolation arguments.

1.2.0.0

Included zip file.

1.1.0.0

Updated to allow for monotonically decreasing x values. Added a documentation html file.

1.0.0.0