error ??? Index exceeds matrix dimensions.
Afficher commentaires plus anciens
%
--------------------------------------------------------------------------
%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 1000x40 double Any expert can u help me...thank you!!!
1 commentaire
kjetil87
le 5 Déc 2013
I didnt check the entire code but It migh be because of
ou=d(41:40,1:1000);
this is and empty matrix... Correct syntax is
ou=d(41:-1:40,1:1000);
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Define Shallow Neural Network Architectures dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!