![xcorr.png](https://www.mathworks.com/matlabcentral/answers/uploaded_files/200578/xcorr.png)
Correlation on distributed array
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Soumyadipta Sengupta
le 8 Jan 2019
Réponse apportée : Heiko Weichelt
le 11 Jan 2019
I would like to compute autocorrelation using the xcorr function on a distributed array. Would this be possible?
0 commentaires
Réponse acceptée
Heiko Weichelt
le 11 Jan 2019
Hi Soumyadipta
Although xcorr does not show up on the methods list of distributed
methods('distributed')
you can use xcorr with distributed inputs.
xcorr is written in MATLAB code and all functions that are used inside support distributed and, therefore, the distributed input literally flows through producing distributed results.
There are quite a few of those functions in MATLAB that we call 'flowthrough' functions.
Modifying the example of xcorr's help text demonstrates the usage:
N = 16;
n = 0:N-1;
a = 0.84;
b = 0.92;
xa = distributed(a).^n;
xb = distributed(b).^n;
[r,lags] = xcorr(xa,xb);
stem(lags,r)
![xcorr.png](https://www.mathworks.com/matlabcentral/answers/uploaded_files/200578/xcorr.png)
Meaning, you do not need to change any of your code.
I hope this helps. Feel free to get back with additional questions or if you discover any use-cases that do not work right now.
Best,
Heiko
0 commentaires
Plus de réponses (0)
Voir également
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!