sabrina_tqx 发表于 2009-5-21 17:01

急求助,6.8答辩

怎样用anfis表示y=sin(x1)+x2,其中x1(0~6.28),x2(-2,2)
看了help,可是其中只是一组数据的输入,求各位大侠帮帮忙

friendchj 发表于 2009-5-21 17:25

仔细看看help
trnData: the name of a training data set. This matrix contains data input in all but the last column. The last column contains a single vector of output data.
%%%% 自己根据自带例子写的多变量输入,不知正确否
clc
clear
x1 =linspace(0,6.28,20)';
x2=linspace(-2,2,20)';
y =sin(x1)+x2;
trnData = ;
numMFs = 5;
mfType = 'gbellmf';
epoch_n = 20;
in_fis = genfis1(trnData,numMFs,mfType);
out_fis = anfis(trnData,in_fis,20);
plot(y)
hold on
plot(evalfis(,out_fis),'ro');
legend('Training Data','ANFIS Output');
页: [1]
查看完整版本: 急求助,6.8答辩