Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: how newff works in matrix?
Date: Sun, 9 Nov 2008 09:32:02 +0000 (UTC)
Organization: UTSA
Lines: 15
Message-ID: <gf6ami$b39$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-03-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1226223122 11369 172.30.248.38 (9 Nov 2008 09:32:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Sun, 9 Nov 2008 09:32:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1332985
Xref: news.mathworks.com comp.soft-sys.matlab:499729


newff works well in vectors, how about in matrices?
Here is the code:
%% begin
P=[linspace(0.3,0.1,5);linspace(0.4,0.2,5);linspace(0.5,0.3,5);linspace(0.6,0.4,5)];
T=meshgrid(1:5,1:4);
net = newff(minmax(P),[19,25,4],{'tansig','tansig','purelin'},'trainlm');
net.trainParam.epochs = 1000;
net.trainParam.goal = 0.0001;
net = train(net,P,T);
 y1=sim(net,P);
 Q=meshgrid(linspace(0.3,0.1,5),1:4);
 y2=sim(net,Q);
 %% end
 In this example, I thought y2(1,:) would be equal or apoximate to y1(1,:),but it's not.
 Why? How to modify the code to get it?