Path: news.mathworks.com!not-for-mail
From: "Jame " <phuongr3k2@gmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: help me about 1-step ahead feedforward
Date: Sun, 6 Oct 2013 13:51:11 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 24
Message-ID: <l2rpsf$lr6$1@newscl01ah.mathworks.com>
Reply-To: "Jame " <phuongr3k2@gmail.com>
NNTP-Posting-Host: rubyext-06-ls.mathworks.com
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: newscl01ah.mathworks.com 1381067471 22374 172.20.102.182 (6 Oct 2013 13:51:11 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Sun, 6 Oct 2013 13:51:11 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 4670343
Xref: news.mathworks.com comp.soft-sys.matlab:803346

hello everybody,
I'm a newbie in both mathlab and neural network. So When I meet some trouble when I apply mathlab for feedforward, please help me.
My data divede two set: sample and test. 
And My model is: y(t) = f(x(t-1),x(t-2),...x(t-d)) on the sample.
Here is my code:

[X,T] = simpleseries_dataset;
N = 20;%No.of test patterns
input_sample  = X(1,1:end-N);
target_sample = T(1,1:end-N);
input_test = X(N+1:end);
target_test = T(N+1:end);
net = narxnet(1:2,[],10)
net.divideParam.trainRatio = 0.85;
net.divideParam.valRatio = 0.15;
net.divideParam.testRatio = 0;
net.divideFcn='divideblock';
[Xs,Xi,Ai,Ts] = preparets(net,input_sample,target_sample) % target here is non-feedback
[net tr] = train(net,Xs,Ts,Xi,Ai);

But I have  a problem with preparet function. And I don't know what the reason. Here target is non-feedback (Tnf), but when I change it to feedback (Tf) that it works!!!!.
And I don't know how apply it to predict on my test set .Just need for 1-step ahead.
Please help me fix problems above.
Thank for your help