Help combine the two scripts
    2 visualizaciones (últimos 30 días)
  
       Mostrar comentarios más antiguos
    
Maybe someone can help connect these two scripts:
clear all;
x=[2 2 2 2 2 2 2 2 2 2]
autocorr(x);
N=length(x);
y=x;
z=x;
for i=1:N-1
    for i=N-1:-1:1
        x(i+1)=x(i);
    end
    x(1)=0;
    z=[z; x];
end;
m=[z]*[y'];
m=m/N
stem(m);
title('auto-correlation');
xlabel('time index');
ylabel('amplitude');
and
clear all;
x=[2 2 2 2 2 2 2 2 2 2]
autocorr(x);
N=length(x);
y=x;
z=x;
for i=1:N-1
    for i=N-1:-1:1
        x(i+1)=x(i);
    end
    x(1)=0;
    z=[z; x];
end;
m=[z]*[y'];
g=m/N
stem(g, g');
title('auto-correlation');
xlabel('time index');
1 comentario
  per isakson
      
      
 el 18 de Mayo de 2014
				
      Editada: Image Analyst
      
      
 el 19 de Mayo de 2014
  
			The two scripts looks nearly identical to me. What do you mean by "connect" or "combine" ?
Respuestas (1)
  Raghunandan V
      
 el 5 de Oct. de 2018
            % clear all;
x=[2 2 2 2 2 2 2 2 2 2]
autocorr(x);
N=length(x);
y=x;
z=x;
for i=1:N-1
    for i=N-1:-1:1
        x(i+1)=x(i);
    end
    x(1)=0;
    z=[z; x];
end;
m=[z]*[y'];
g=m/N
stem(g, g');
title('auto-correlation');
xlabel('time index');
m=m/N
stem(m);
title('auto-correlation');
xlabel('time index');
ylabel('amplitude');
0 comentarios
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


