4.33333

4.3 | 3 ratings Rate this file 13 downloads (last 30 days) File Size: 33.54 KB File ID: #4012

prcorr2 - 10 times faster correlation coef.

by Peter Rydesäter

 

26 Sep 2003 (Updated 30 Sep 2003)

Code covered by the BSD License  

Compute correlation coefficient over all dimensions.

Download Now | Watch this File

File Information
Description

This is a faster implementation of MATLAB's corr2. Implemented as a mex-file generated with the ITERATOR tool that can be downloaded from www.mathworks.com

Re compile the source with MEX -O prcorr2.c
     
C = PRCORR2(A,B) computes the correlation between A and B. A and B are arrays witn any number of dims but with same number of elements
  
     Class Support
     -------------
     A and B can be any numeric type but not complex value. C is a scalar double.
  
     See also CORR2, CORRCOEF, STD2, ITERATOR, MEX

In future I may complement this fast function with a set of them that can replace some slow MATLAB functions.
 
     (C) 2003 Peter Rydesäter, http://www.rydesater.com

Acknowledgements

The author wishes to acknowledge the following in the creation of this submission:
TCP/UDP/IP Toolbox 2.0.6

MATLAB release MATLAB 6.5 (R13)
Zip File Content  
Other Files fastop/prcorr2.c,
fastop/prcorr2.dll,
fastop/prcorr2.m,
fastop/prcorr2.mexglx,
license.txt
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (4)
16 Jul 2004 mani thomas

very useful

22 Dec 2004 SeungSchik Yoo

Very good code... with my real-life experience on imaging processing, it is about 3 times as fast as corrcoef.m and 50% faster than corr2.m

13 Jul 2005 Bernard Schenk

Define two 2x2 matrix of ones.
Try prcorrel2 --> result is NaN
Correlation should be one, or am I wrong?
That's why I give the N/A rating, just like the function ...

25 Oct 2005 Yong Du

Really fast! I like it very much.

Please login to add a comment or rating.
Tag Activity for this File
Tag Applied By Date/Time
audio processing Peter Rydesäter 22 Oct 2008 07:08:08
video processing Peter Rydesäter 22 Oct 2008 07:08:08
corr2 Peter Rydesäter 22 Oct 2008 07:08:08
correlation Peter Rydesäter 22 Oct 2008 07:08:08
mex Peter Rydesäter 22 Oct 2008 07:08:08
signal Peter Rydesäter 22 Oct 2008 07:08:08
image Peter Rydesäter 22 Oct 2008 07:08:08
fast Peter Rydesäter 22 Oct 2008 07:08:08

Contact us at files@mathworks.com