×
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

NARX Neural Network

NARX Neural Network

NARX Neural Network

(OP)
Hello all,
I've started using the Neural Network toolbox V5.0 and got stuck...  I followed the documentation for the "NARX Network" and got the example to work, not hard to copy/paste.  Now I'm trying to figure out how I would add another input to this model, say I'd need to input, position, voltage and now temperature, just as an example.  I've tried to modify the code but keep erros about the size of the inputs...  could someone help me figure out this one?  I've pasted the documentation example below for reference.

thanks...  John
Virginia Tech

"""
clear all;close all;

load magdata
[u,us] = mapminmax(u);
[y,ys] = mapminmax(y);
y = con2seq(y); u = con2seq(u);
p = [u(3:end);y(3:end)]; t = y(3:end);
 
d1 = [1:2];
d2 = [1:2];
narx_net = newnarxsp({[-1 1],[-1 1]},d1,d2,[10 1],{'tansig','purelin'});
narx_net.trainFcn = 'trainbr';
narx_net.trainParam.show = 10;
narx_net.trainParam.epochs = 600;

for k=1:2,
  Pi{1,k}=u{k};
end
for k=1:2,
  Pi{2,k}=y{k};
end
narx_net = train(narx_net,p,t,Pi);

yp = sim(narx_net,p,Pi);
e = cell2mat(yp)-cell2mat(t);
plot(e)
"""

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