image thumbnail

Two point correlation function of a finite 2D lattice

version 1.5.0.0 (3.56 KB) by Ilya Valmianski
Compute the two point correlation function of a finite 2D lattice.

1.7K Downloads

Updated 22 Apr 2014

View License

Computes the distance 2-point correlation function of a finite 2D lattice. The functions is:
[ coorfun r rw] = twopointcorr(x,y,dr,blksize,verbose)

Where x is the list of x coordinates of lattice points. y is the list of y coordinates of the lattice points,and dr is the binning length for the correlation function. blksize is the number of points processed at a time. verbose is a boolean on whether to display current progress.

The outputs are coorfun, r, and rw. Coorfun is a vector of normalized correlation function values for distances recorded in the r vector. rw is the weight (number of points) contributing to corrfun calculation at a particular r. Low rw means that corrfun at that r value is unreliable.

This function has been fully vectorized to improve performance.

Cite As

Ilya Valmianski (2021). Two point correlation function of a finite 2D lattice (https://www.mathworks.com/matlabcentral/fileexchange/31353-two-point-correlation-function-of-a-finite-2d-lattice), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2010b
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!