×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Are you an
Engineering professional?
Join Eng-Tips Forums!
• Talk With Other Members
• Be Notified Of Responses
• Keyword Search
Favorite Forums
• Automated Signatures
• Best Of All, It's Free!

*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.

# Matlab NARX with multiple inputs

## Matlab NARX with multiple inputs

(OP)

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);
Replies continue below

#### 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.

Close Box

# Join Eng-Tips® Today!

Join your peers on the Internet's largest technical engineering professional community.
It's easy to join and it's free.

Here's Why Members Love Eng-Tips Forums:

• Talk To Other Members
• Notification Of Responses To Questions
• Favorite Forums One Click Access
• Keyword Search Of All Posts, And More...

Register now while it's still free!