trend
* * * 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.
Zitieren als
Chad Greene (2024). trend (https://www.mathworks.com/matlabcentral/fileexchange/46363-trend), MATLAB Central File Exchange. Abgerufen.
Kompatibilität der MATLAB-Version
Plattform-Kompatibilität
Windows macOS LinuxKategorien
- Sciences > Geoscience > Glaciology >
- MATLAB > Data Import and Analysis > Data Import and Export > Standard File Formats > HDF5 >
- MATLAB > Data Import and Analysis > Data Import and Export > Standard File Formats > NetCDF >
- Sciences > Geoscience > Climate Science and Analysis >
Tags
Quellenangaben
Inspiriert von: Bedmap2 Toolbox for Matlab, deseason
Inspiriert: 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!Live Editor erkunden
Erstellen Sie Skripte mit Code, Ausgabe und formatiertem Text in einem einzigen ausführbaren Dokument.
Version | Veröffentlicht | Versionshinweise | |
---|---|---|---|
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 |