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
謝辞

ヒントを得たファイル: Bedmap2 Toolbox for Matlab, deseason

ヒントを与えたファイル: downsample_ts, Statistical Analysis, xcorr3, EOF, detrend3, polyplot, Sea level rise trend interpolator

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