Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
newnarx error

Subject: newnarx error

From: Christine

Date: 27 Feb, 2008 07:35:02

Message: 1 of 4

Hi.. Can someone please help me to figure out what is the
problem with the codes below..
Source code:
http://www.mathworks.com/access/helpdesk/help/toolbox/nnet/index.html?/access/helpdesk/help/toolbox/nnet/newnarx.html&http://www.google.com/search?q=newnarx


% A problem consisting of sequences of inputs P and targets T
P = {[0] [1] [1] [0] [-1] [-1] [0] [1] [1] [0] [-1]};
T = {[0] [1] [2] [2] [1] [0] [1] [2] [1] [0] [1]};

% A two-layer feedforward network with a two-delay input and
two-delay feedback is created.
% The network has one hidden layer of five tansig neurons.
net = newnarx(P,T,[0 1],[1 2],5);

% The network is simulated and its output plotted against
the targets.
Y = sim(net,P);
plot(1:11,[T{:}],1:11,[Y{:}],'o')

% The network is trained for 50 epochs. Again the network's
output is plotted.
net = train(net,P,T);
Yf = sim(net,P);
plot(1:11,[T{:}],1:11,[Y{:}],'o',1:11,[Yf{:}],'+')


When I run the program, this error was prompted out:

Error in ==> newnarx at 7
net = newnarx(P,T,[0 1],[1 2],5);

Subject: newnarx error

From: Ashish Uthama

Date: 29 Feb, 2008 16:24:57

Message: 2 of 4

there has to be more of the error text you might have missed?

On Wed, 27 Feb 2008 02:35:02 -0500, Christine <christine_gee@hotmail.co=
m> =

wrote:

> Hi.. Can someone please help me to figure out what is the
> problem with the codes below..
> Source code:
> http://www.mathworks.com/access/helpdesk/help/toolbox/nnet/index.html?=
/access/helpdesk/help/toolbox/nnet/newnarx.html&http://www.google.com/se=
arch?q=3Dnewnarx
>
>
> % A problem consisting of sequences of inputs P and targets T
> P =3D {[0] [1] [1] [0] [-1] [-1] [0] [1] [1] [0] [-1]};
> T =3D {[0] [1] [2] [2] [1] [0] [1] [2] [1] [0] [1]};
>
> % A two-layer feedforward network with a two-delay input and
> two-delay feedback is created.
> % The network has one hidden layer of five tansig neurons.
> net =3D newnarx(P,T,[0 1],[1 2],5);
>
> % The network is simulated and its output plotted against
> the targets.
> Y =3D sim(net,P);
> plot(1:11,[T{:}],1:11,[Y{:}],'o')
>
> % The network is trained for 50 epochs. Again the network's
> output is plotted.
> net =3D train(net,P,T);
> Yf =3D sim(net,P);
> plot(1:11,[T{:}],1:11,[Y{:}],'o',1:11,[Yf{:}],'+')
>
>
> When I run the program, this error was prompted out:
>
> Error in =3D=3D> newnarx at 7
> net =3D newnarx(P,T,[0 1],[1 2],5);

Subject: newnarx error

From: Greg Heath

Date: 26 Sep, 2013 02:27:06

Message: 3 of 4

"Christine" wrote in message <fq33r6$od0$1@fred.mathworks.com>...
> Hi.. Can someone please help me to figure out what is the
> problem with the codes below..
> Source code:
> http://www.mathworks.com/access/helpdesk/help/toolbox/nnet/index.html?/access/helpdesk/help/toolbox/nnet/newnarx.html&http://www.google.com/search?q=newnarx
>
>
> % A problem consisting of sequences of inputs P and targets T
> P = {[0] [1] [1] [0] [-1] [-1] [0] [1] [1] [0] [-1]};
> T = {[0] [1] [2] [2] [1] [0] [1] [2] [1] [0] [1]};
>
> % A two-layer feedforward network with a two-delay input and
> two-delay feedback is created.
> % The network has one hidden layer of five tansig neurons.
> net = newnarx(P,T,[0 1],[1 2],5);
>
> % The network is simulated and its output plotted against
> the targets.
> Y = sim(net,P);
> plot(1:11,[T{:}],1:11,[Y{:}],'o')
>
> % The network is trained for 50 epochs. Again the network's
> output is plotted.
> net = train(net,P,T);
> Yf = sim(net,P);
> plot(1:11,[T{:}],1:11,[Y{:}],'o',1:11,[Yf{:}],'+')
>
>
> When I run the program, this error was prompted out:
>
> Error in ==> newnarx at 7
> net = newnarx(P,T,[0 1],[1 2],5);

I get no error when I run the code.

Subject: newnarx error

From: Steven_Lord

Date: 26 Sep, 2013 14:08:17

Message: 4 of 4



"Greg Heath" <heath@alumni.brown.edu> wrote in message
news:l2061q$6ck$1@newscl01ah.mathworks.com...
> "Christine" wrote in message <fq33r6$od0$1@fred.mathworks.com>...

*snip*

>> When I run the program, this error was prompted out:
>>
>> Error in ==> newnarx at 7
>> net = newnarx(P,T,[0 1],[1 2],5);
>
> I get no error when I run the code.

Christine, use WHICH to check that you're using the NEWNARX function from
Neural Network Toolbox. I suspect that you're not, since most of those
functions contain much more than five lines of help text (which would make
the first executable line of the function line 7, given the function
declaration on line 1) and I don't think NEWNARX would call itself
recursively that soon in its file.

Also, if you're using a release of MATLAB and Neural Network Toolbox later
than release R2010b, you should use NARXNET instead of NEWNARX. See the item
"Improved Network Creation" in the R2010b section of the Neural Network
Toolbox Release Notes.

http://www.mathworks.com/help/nnet/release-notes.html

--
Steve Lord
slord@mathworks.com
To contact Technical Support use the Contact Us link on
http://www.mathworks.com

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us