
Re: Neural network
Posted:
Mar 9, 2013 2:39 AM


"Murugan Solaiyappan" wrote in message <khbcnn$pih$1@newscl01ah.mathworks.com>... > Dear Matlab friends, > > I am trying to work with the following code (availabe in matlab help) in neural network , > > load house_dataset; > net = newff(houseInputs,houseTargets,20); > net=train(net,houseInputs,houseTargets); > > It works perfectly, the same code modified as follows for my data set, > > load st_inputs.dat; > load st_targets.dat; > inputs=st_inputs(1:1237,1); > targets=st_targets(1:1237,1); > > net = newfit(inputs,targets,20); > net=train(net,inputs,targets); > > > it produce the following error > > ??? Error using ==> plus > Matrix dimensions must agree. > > Error in ==> calcperf2 at 163 > N{i,ts} = N{i,ts} + Z{k}; > > Error in ==> trainlm at 253 > [perf,El,trainV.Y,Ac,N,Zb,Zi,Zl] = > calcperf2(net,X,trainV.Pd,trainV.Tl,trainV.Ai,Q,TS); > > Error in ==> network.train at 216 > [net,tr] = feval(net.trainFcn,net,tr,trainV,valV,testV); > > Error in ==> netfit_stock at 10 > net=train(net,stockinputs,stocktargets); > > and also i am using newff instead of newfit. This line also produce the same error. > I can't understand this error.
For N Idimensional inputs and N corresponding Odimensional output targets, your matrices must have the dimensions
[ I N ] = size(inputs)
[ O N ] = size(targets)
Perhaps you need to transpose.
Hope this helps.
Greg

