load mgdata.dat
t=mgdata(:,1);%t为一列,时间序列
x=mgdata(:,2);%x为一列,输入数据
figure;
plot(t,x);
%subplot(2,2,1)
%plotmf(fismat,'input',1)
%subplot(2,2,3)
%plotmf(fismat,'input',2)
%subplot(2,2,2)
%plotmf(fismat,'input',3)
%subplot(2,2,1)
%plotmf(fismat,'input',4)
for t=118:1117%t取1000个为训练数据与检测数据的个数和 取40.。
Data(t-117,:)=[x(t-18) x(t-12) x(t-6) x(t) x(t+6)];
end
trnData=Data(1:500,:);
chkData=Data(501:end,:);
fismat=genfis1(trnData);
t=mgdata(:,1);
[fismat1,error1,ss,fismat2,error2]=anfis(trnData,fismat,[],[],chkData);
figure;
plot(error1,'r');
hold on;
plot(error2,'k');
anfis_output=evalfis([trnData(:,1:4);chkData(:,1:4)],fismat2);
index=124:1123;
figure;
plot(t(index),[x(index) anfis_output]);
figure;
plot(t(index),x(index)-anfis_output);
partyuce.zip_Fuzzy prediction_模糊预测_自适应预测_预测 matlab
版权申诉
64 浏览量
2022-07-13
20:17:12
上传
评论
收藏 567B ZIP 举报
朱moyimi
- 粉丝: 65
- 资源: 1万+