trend

버전 1.1.0.1 (3.83 KB) 작성자: Chad Greene
Fast function for mapping trends along any dimension in 3D data.
다운로드 수: 2.8K
업데이트 날짜: 2021/3/25

라이선스 보기

* * * NOTICE * * * A NEW AND IMPROVED VERSION OF THIS FUNCTION CAN BE FOUND IN THE CLIMATE DATA TOOLBOX FOR MATLAB. GET IT HERE: https://www.mathworks.com/matlabcentral/fileexchange/70338

This function returns linear least-squares slopes along any dimension of any N-dimensional data set. The function was designed with large 3D netCDF climate reanalysis data sets in mind, but it will also work data sets of smaller or larger dimensions. This function is much faster and cleaner than the common method of nesting loops, for example, to solve for each lat and lon or each x and y.

An example of how one might use this function is shown in the image at the top of this page. To create this image I used daily surface wind and sea surface temperature fields (ECMWF ERA-Interim) from 1990 through 1999 to solve for trends in SST, zonal wind, and meridional wind. In the 90s, the sea surface cooled around most of Antarctica, but warmed in the Weddell sea, where the meridional component of surface winds strengthened.

SYNTAX:
s = trend(A)
s = trend(A,Fs)
s = trend(A,t)
s = trend(...,dim)
s = trend(A,[],dim)
[s,int] = trend(...)

DESCRIPTION:
s = trend(A) returns the (N-1)-dimensional matrix s corresponding to the linear trend(s) along dimension 1 of A. Assumes data are evenly spaced along dimension 1.

s = trend(A,Fs) declares sampling frequency Fs along trending dimension of A.

s = trend(A,t) allows for unevenly-spaced data in the trending dimension with time vector t. length of t must equal the length of A along its trending dimension.

s = trend(...,dim) returns the trend along dimension dim of A.

s = trend(A,[],dim) assumes data are sampled at 1 Hz or 1/(unit time) or 1/(unit space), etc.

[s,int] = trend(...) also returns the intercepts of the slope-intercept form.

The header of the function contains several usage examples.

인용 양식

Chad Greene (2024). trend (https://www.mathworks.com/matlabcentral/fileexchange/46363-trend), MATLAB Central File Exchange. 검색됨 .

MATLAB 릴리스 호환 정보
개발 환경: R2012b
모든 릴리스와 호환
플랫폼 호환성
Windows macOS Linux

Community Treasure Hunt

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

Start Hunting!
버전 게시됨 릴리스 정보
1.1.0.1

text description.

1.1.0.0

Version 2: now supports any ND data sets and returns intercept values -- Thanks Matt J.

1.0.0.0