相关代码 |
|
%cc.m/created by PJNahin for "Duelling Idiots"(3/31/99) %This program generates a random vector, X, of length %20,009 and then calculates the correlation coefficient %X(n) and X(n+j) for j = 0,1,2,...,9. % % rand('state',100*sum(clock)) for i=1:20010 X(i)=rand; end for j=0:9 summation=0; for i=1:20000 summation=summation+X(i)*X(i+j); end coefficient=(12*summation/20000)-3 end
相关资源 |
|