spatialcorr2( varargin)

Spatial Correlation of 2D datasets (without having timesteps)


Updated 9 Jan 2018

View License

%Created by Ankur Kumar Wednesday; January 03, 2018
% Version: 1.0
% National Institute of Techonology, Rourkela
% Rourkela, Odisa - 769008, India
% Department of Earth and Atmospheric Sciences
% Email:
% Function:
% (Not recommended) If you have hourly or half hourly or 6 hourly
% data, then it is recommended to include time steps in your data
% sets and use spatialcorr3.
% spatialcorr2 uses interpolation of data sets on its finer grids
% and then find the correlation of the matrix formed by
% interpolating the data into its subgrids (Between two grid point of latitude and longitude, it divided
% the grides into its subgrids.). Interpolating the
% data swallow the accuracy of data sets. That's why, it''s not
% recommended. (For details, see the documentation)
% Syntax:
% C=spatialcorr2(lon,lat, data1,data2 );
% First and second input should be longitudes and latitudes of
% the data set. Third and fourth input should be the data between
% which you want to find spatial correlation.
% By default, fifth argument is set to 7. This means that
% function divided the corresponding grids into 7 subgrids and
% then it interpolates.
% Example:
% C=spatialcorr2(lon,lat, data1,data2 );
% Please send your suggestions to the email id: or

Cite As

ANKUR KUMAR (2023). spatialcorr2( varargin) (, MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2015b
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

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

Start Hunting!
Version Published Release Notes