Skip to Main Content Skip to Search
Product Documentation

corr2 - 2-D correlation coefficient

Syntax

r = corr2(A,B)

Description

r = corr2(A,B) computes the correlation coefficient between A and B, where A and B are matrices or vectors of the same size.

Class Support

A and B can be numeric or logical. The return value r is a scalar double.

Examples

Compute the correlation coefficient between an image and the same image processed with a median filter.

I = imread('pout.tif');
J = medfilt2(I);
R = corr2(I,J) 
R =

    0.9959

Algorithms

corr2 computes the correlation coefficient using

where = mean2(A), and = mean2(B).

See Also

corrcoef | std2

  


Recommended Products

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.

 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS