Autocorrelation with big data

1 visualización (últimos 30 días)
Abdur Rob
Abdur Rob el 12 de Jun. de 2021
Comentada: Sulaymon Eshkabilov el 12 de Jun. de 2021
I have written this code to find autocorrlation
temp = xlsread('temp.xlsx');
tempnorm = temp - mean(temp);
fs = 2*24; % 2 times per hours
t = (0:length(tempnorm)-1)/fs;
plot(t, tempnorm); xlabel 'Time in days'; ylabel 'Temp'; axis tight
[autocor, lags] = xcorr(tempnorm, 3*7*fs, 'coeff');
plot(lags/fs, autocorr);
when i try to run this it shows
Index exceeds the number of
array elements (0).
Error in autocorr (line 143)
y = args{1};
please help me to figure it out

Respuesta aceptada

Sulaymon Eshkabilov
Sulaymon Eshkabilov el 12 de Jun. de 2021
One typo that caused the error:
plot(lags/fs, autocor); % autocor is the variable name NOT autocorr
  2 comentarios
Abdur Rob
Abdur Rob el 12 de Jun. de 2021
thank you
Sulaymon Eshkabilov
Sulaymon Eshkabilov el 12 de Jun. de 2021
Most welcome!

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Loops and Conditional Statements en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by