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:
Input for Neural Network

Subject: Input for Neural Network

From: Jess J

Date: 20 Feb, 2009 03:35:03

Message: 1 of 1

Hi all,
I ve written a program for Neural Network input (based on the example in matlab help). To train the data using Rprop.
Here goes my coding:

p = [0100000101100010011100100110000101101000011000010110110101100101 0100000101100100011001000110100101110011011011110110111000100000 0100000101100100011000010110110100100000000000000000000000000000 0110000101101100011001010110001100100000000000000000000000000000 0100000101101110011000010110111001100100001000000000000000000000];
t = [0011000100110010001100110110010101100100011101010111010001110111;
00110100001110000011000100110110001101110011010000110111;
01100001011000010111001001101111011011100000101000000000;
01001101010101000101011000001010000000000000000000000000;
00110100001110000011011000110110001101000011010000110111];
net = newff(p,t,3,{},'trainrp');
net = train(net,p,t);
y = sim(net,p)

However, I ve got some error. Can anyone please help me how to solve these errors?
These are the errors i get in the command window:

??? Error using ==> network.train at 146
Targets are incorrectly sized for network.
Matrix must have 5 columns.

Error in ==> Untitled3 at 8
net = train(net,p,t);

The coding in the example is as below:
p = [-1 -1 2 2;0 5 0 5];
t = [-1 -1 1 1];
net = newff(p,t,3,{},'trainrp');
net = train(net,p,t);
y = sim(net,p)

Thanks in advance.

Best Regards,
Jess

Tags for this Thread

No tags are associated with 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