Autocorelation of only the colums in the matrix

1 回表示 (過去 30 日間)
Soumya Jain
Soumya Jain 2021 年 4 月 5 日
回答済み: Pratyush Roy 2021 年 4 月 26 日
I have a matrix of dimension(m*n) i have to perform autocorelation on the rows, so the my output matrix has dimenstion (2m-1*n)

回答 (1 件)

Pratyush Roy
Pratyush Roy 2021 年 4 月 26 日
Hi,
As per my understanding, you are trying to find the autocorrelation sequence of the columns of the matrix. The xcorr function can be used to obtain the autocorrelation sequence for each column. The following code snippet might be helpful to understand how to create the matrix containing the autocorrelation sequence
[m,n] = size(x); % Here x is the matrix of dimension m*n
autocorr = [];
for i=1:n
autocorr = [autocorr xcorr(x(:,i))]; %Taking autocorrelation of the column and appending to the autocorr matrix
end
Finally the autocorr matrix will be of dimension 2m-1*n
Hope this helps!

カテゴリ

Help Center および File ExchangeCorrelation and Convolution についてさらに検索

製品


リリース

R12.1

Community Treasure Hunt

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

Start Hunting!

Translated by