From: "Jame " <>
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$>
Reply-To: "Jame " <>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: 1381067471 22374 (6 Oct 2013 13:51:11 GMT)
NNTP-Posting-Date: Sun, 6 Oct 2013 13:51:11 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 4670343
Xref: 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;
[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