input of neural network

2 views (last 30 days)
dalya
dalya on 11 Mar 2013
Am working on neural network , my problem is if I want the input to be one element and the output is array which is the target also , matlab will give me error that the network requires the input and target to be equal size how can I avoid this ?
  2 Comments
the cyclist
the cyclist on 11 Mar 2013
It would be helpful if you could give a significantly greater amount of detail about the size of your arrays, and the exact calling syntax.
The ideal is to show us a small amount of self-contained code that exhibits the problem.
dalya
dalya on 11 Mar 2013
x0=1;
h={ 1.9587
0.2019
0.1143
0.7755
0.9941
0.2891
0.1365
1.1539
0.4221
0.7484
1.7563
0.8967
3.2528
6.0139
0.3404
27.0322
80.6179
122.5317
140.2751
143.8728
143.0217
134.0189
104.6347
53.0908
8.2582
1.7217
6.7878
0.1695
2.6677
0.0643
1.5761
0.1948
0.4570
1.0072
0.2943
0.0525
0.8049
1.5823
1.5565
0.6357};
m0=h';
net = newff(x0,m0,10);
net = train(net,x0,m0);
outputs = net(x0);
n=cell2mat(outputs)
l=cell2mat(x0)
k=cell2mat(m0)
polar(l*pi/180,k,'b')
hold on
polar(l*pi/180,n,'r')
this is my code .. when the onput is set to x0=1 I need the output to be m0

Sign in to comment.

Accepted Answer

Greg Heath
Greg Heath on 11 Mar 2013
Edited: Greg Heath on 11 Mar 2013
If you have N I-dimensional input vectors and the corresponding N O-dimensional output vectors, the input and output matrices will have the dimensions
[ I N ] = size(input)
[ O N ] = size(target)
Thank you for formally accepting my answer
Greg
  1 Comment
dalya
dalya on 11 Mar 2013
my problem is the input and the output have different size so the network give me an error

Sign in to comment.

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!