correlation.m

来自「一些常被用于教学或者参考的概率论的实例的源代码」· M 代码 · 共 24 行

M
24
字号
%correlation.m/created by PJNahin for "Duelling Idiots"(1/30/99)
%This  m-file plots the scatter diagram of the points (x(i),x(i+j))
%for any value of j => 0.
%
%
rand('state',100*sum(clock));    %set new seed for generator;
clear data
clear x
clear y
j=input('What is j? ');
stop=1000+j;
data=zeros(1,stop);
for i=1:stop
   data(i)=rand;
end
for i=1:1000
   x(i)=data(i);
   y(i)=data(i+j);
end
plot(x,y,'.')
xlabel('j = 9')
title('1000-Point Scatter Diagram for MATLAB 5.2 Uniform Random Number Generator')
figure(1)

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?