Рend;Рslope= median( slope1 );Р2、M-K突变检验Рclc;Рy=data(1:50,6);%输入数据Рn=length(y);РSk=zeros(size(y));РUFk=zeros(size(y));Рs1=0;Рfor i=2:n % Р for j=1:iР if y(i)>y(j) Р s1=s1+1; Р elseР s1=s1+0; % ()Р end;Р end;РSk(i)=s1; % РE=i*(i-1)/4; РVar=i*(i-1)*(2*i+5)/72; РUFk(i)=(Sk(i)-E)/sqrt(Var); % Рend;Р Рy2=zeros(size(y));РSk2=zeros(size(y));РUBk=zeros(size(y)); Рs2=0;Рfor i=1:nР y2(i)=y(n-i+1);Рend;Рfor i=2:nР for j=1:iР if y2(i)>y2(j)Р s2=s2+1;Р elseР s2=s2+0;Р end;Р end;РSk2(i)=s2;Р E=i*(i-1)/4; % Sk2(i)的均值Р Var=i*(i-1)*(2*i+5)/72; % Sk2(i)的方差%Р UBk(i)=0-(Sk2(i)-E)/sqrt(Var);Рend;Р UBk2=zeros(size(y));Рfor i=1:nР UBk2(i)=UBk(n-i+1);Рend;Рyear=1961:2010;Рyear=year';Рxlswrite('D:\test.xls',year,'Sheet1','A1'); Рxlswrite('D:\test.xls',UFk,'Sheet1','B1');Рxlswrite('D:\test.xls',UBk2,'Sheet1','C1');