部分代码(内含3个例子,1分绝对划算): function yc0=GM1(x0,N) %x0 is the original data , %N is the number you want to predict. n=length(x0); for i=1:n x1(i)=sum(x0(1:i)); end % for k=2:n % 紧邻均生成 z % z(k)=0.5*x1(k)+0.5*x1(k-1);
部分代码: %模糊聚类程序 function f=mujl(x,lamda) %输入原始数据以及lamda的值 if lamda>1 disp('error!') %错误处理 end [n,m]=size(x); xmax=max(x);xmin=min(x); x=(x-xmin(ones(n,1),:))./(xmax(ones(n,1),:)-xmin(ones(n,1),:))