Advertisement

matlab\netlab code.(need help to find the problem)

Started by October 23, 2005 05:28 AM
-1 comments, last by kingrico 19 years, 1 month ago
this is the matlab code i used the matlab\netlab using the MLP algorithm load('mail.dat') //(600*16) for i = 1: 16 // nomalization mini= min(mail(:,i)); maxi = max(mail(:,i)); mail(:,i)= (mail(:,i)-mini)/maxi; end no_data=size(mail) training = mail (1:1.5:no_data,:); // (400*16) validation = mail(1.5:6:no_data,:); // (100*16) testing= mail(6:6:no_data,:); // (100*16) for i = 1: (size(training,1)) ts = training (i,3); ts = reshape(ts,size(ts,1)*size(ts,2),1); tset(i,:) = ts'; target(i) = training(i,3); end target =target'; for i=1:(size(validation,1)) ts = validation(i,3); ts = reshape(ts,size(ts,1)*size(ts,2),1); vset(i,:) = ts'; vtarget(i) = validation(i,3); end vtarget = vtarget'; for i=1:(size(testing,1)) ts = testing(i,3); ts = reshape(ts,size(ts,1)*size(ts,2),1); testset(i,:) = ts'; testtarget(i) = testing(i,3); end testtarget = testtarget'; net = mlp(4,3,1,'linear') for i=1:20 [net,error] = mlptrain(net,tset,target,10); plot(i*100,error,'r+'); end ??? Error using ==> mlperr Dimension of inputs 1 does not match number of model inputs 4 Error in ==> neterr at 23 [s{1:nargout}] = feval(errstr, net, x, t); Error in ==> scg at 79 fold = feval(f, x, varargin{:}); % Initial function value. Error in ==> netopt at 36 [s{1:nargout}] = eval(optstring); Error in ==> mlptrain at 21 [net, options] = netopt(net, options, x, t, 'scg'); can any one tell me whats wrong with my code.i dont know what the problems are . thanks. [Edited by - kingrico on October 23, 2005 8:48:14 PM]

This topic is closed to new replies.

Advertisement