×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Matlab NARX with multiple inputs

Matlab NARX with multiple inputs

Matlab NARX with multiple inputs

(OP)
thread575-155285: NARX Neural Network

I realize this is a bit late, but hopefully this may save someone else a headache in the future.  It's currently 2010 and Matlab's documentation on this subject still isn't any better than it was in 2006.  Instead of doing something like this:

a={[0.1] [0.2] [0.3] [0.4] [0.5] [0.6] [0.7] [0.8] [0.9] [1.0]};
b={[-0.1] [0.2] [-0.3] [0.4] [-0.5] [0.6] [-0.7] [0.8] [-0.9] [1.0]};
c={[-0.2] [0.4] [-0.6] [0.8] [-0.2] [0.4] [-0.6] [0.8] [-0.2] [0.4]};
d1=[1 2];
d2=[1 2];
narx_net = newnarxsp({[0.1 1.0],[-0.9 1.0],[-0.6 0.8]},d1,d2,[5 1],{'tansig','purelin'});
p=[a;b;c] ;
t=c;
narx_net.trainFcn = 'trainbr';
narx_net.trainParam.show = 10;
narx_net.trainParam.epochs = 600;
narx_net = train(narx_net,p,t);

Do something like this:

a=cell2mat(a);
b=cell2mat(b);
c=cell2mat(c);
d1=[1 2];
d2=[1 2];
narx_net = newnarxsp({[0.1 1.0;-0.9 1.0],[-0.6 0.8]},d1,d2,[5 1],{'tansig','purelin'});
p=[a;b;c];
P=mat2cell(p,[size(p,1)-1 1],ones(size(p,2),1));
T=mat2cell(c,1,ones(size(c,2),1));
narx_net.trainFcn = 'trainbr';
narx_net.trainParam.show = 10;
narx_net.trainParam.epochs = 600;
narx_net=train(narx_net,P,T);

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources