Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: how newff works in matrix?
Date: Mon, 10 Nov 2008 02:30:06 +0000 (UTC)
Organization: UTSA
Lines: 17
Message-ID: <gf86be$t96$1@fred.mathworks.com>
References: <gf6ami$b39$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1226284206 29990 172.30.248.37 (10 Nov 2008 02:30:06 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Mon, 10 Nov 2008 02:30:06 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1332985
Xref: news.mathworks.com comp.soft-sys.matlab:499833


"Ning" <ning.robin@gmail.com> wrote in message <gf6ami$b39$1@fred.mathworks.com>...
> 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 made it?
anybody can help me? just run the code, you'll see the result.