First argument of XCORR must be a vector?
Mostra commenti meno recenti
In the help description of cross-correlation command XCORR, the first argument can be specified as a vector, matrix, or multidimensional array.
But my Matlab 2020b and matlab online threw an error: Error using xcorr (line 93) First argument must be a vector.
The test code is simple as:
xcorr(magic(4), [1; 2; 3;4])
Risposte (1)
Walter Roberson
il 8 Ago 2021
Yes, the first parameter to xcorr can be a vector, matrix, or multidimensional array. However, if you look at https://www.mathworks.com/help/matlab/ref/xcorr.html#description you will see that in the case that you pass in two parameters, then both parameters must be vectors.
xcorr(x,y) --> must both be vector
xcorr(x) --> not restricted to vector
1 Commento
Zhangjun Yu
il 8 Ago 2021
Categorie
Scopri di più su Correlation and Convolution in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!