%
--------------------------------------------------------------------------%define input and output for training
in=d(1:40,1:1000); ou=d(41:40,1:1000); trainInput= d(1:40,201:1000); % input for training
trainOutput= d(41:40,201:1000); % output for training
%--------------------------------------------------
% training the MLP Neural network
% newff(input, target,[hidden layer1 hiddenlayer2 output],{transferFunction1 transferFunction2 transferFunction3});
% transferFunction defult for hidden layer is tansig but here use logsig
% and purelin is default transferFunction for output layer
net = newff(minmax(in),ou,[10 10 4],{'logsig' 'logsig' 'purelin'}); %--------------------------------------------------------------------------
% Setting the parameters for training
net.trainParam.epochs = 1000; %set the maximum number of epochs to train
net.trainParam.goal = 0.02; %sum-squared error goal.
%--------------------------------------------------------------------------
% training the MLP by using a a train function
net = train(net,trainInput,trainOutput); %--------------------------------------------------------------------------% To draw the result making the testing
testInput=d(1:40,1:200); % extract certain column for testing input
testResult1=sim(net,testInput); % simulate the MLP network by using a sim function
testResult1 = testResult1';trainOutput2= d(1:40,1:200);??? Index exceeds matrix dimensions.
above is my code for fold 1 (train set is 201-1000, test set is 1-200) i use dataset 1000×40 double Any expert can u help me…thank you!!!
Best Answer