Why do I encounter an error in MSEREG when using the Neural Network Toolbox 4.0.1 (R12.1)?
The following code generates an error in the Neural Network Toolbox 4.0.1 (R12.1):
p = [-1 -1 2 2;0 5 0 5];t = [-1 -1 1 1];net=newff(minmax(p),[3,1],{'tansig','purelin'},'traingd');net.performFcn = 'msereg';net.performParam.ratio = 0.5;net.trainParam.show = 5;net.trainParam.epochs = 300;net.trainParam.goal = 1e-5;[net,tr]=train(net,p,t);
??? Error using ==> .^ Function '.^' not defined for variables of class 'struct'. Error in ==> D:\Applications\MATLAB\toolbox\nnet\nnet\msereg.m On line 126 ==> perfx = sum(sum(x.^2))/length(x); Error in ==> C:\Temp\matlab_nnet\tp374613.m On line 54 ==> perf = msereg(El,net,net.trainParam); Error in ==> D:\Applications\MATLAB\toolbox\nnet\nnet\traingd.m On line 202 ==> [perf,El,Ac,N,Zl,Zi,Zb] = feval(simfuncname,net,Pd,Ai,Tl,Q,TS); Error in ==> D:\Applications\MATLAB\toolbox\nnet\nnet\@network\train.m On line 278 ==> [net,tr,Ac,El] = feval(trainFcn,net,Pd,Tl,Ai,Q,TS,VV,TV);
The error seems to be caused by the format of the temporary network simulation file which the Neural Network Toolbox creates. This file calls MSEREG with the incorrect type of inputs.
Best Answer