I am quite new to MATLAB and extrmely new to neural networks. I have created a feed forward neural network using newff(). I input a matrix of size 486*1200 and output matrix 6*1200. When I simulate the network using sim() function after training, I get correct output. But when I try to simulate on any other input of shorter size I get error which says input matrix should have 486 rows (as that of training matrix).
Can anyone resolve this issue for me to generalize the network for any size of input? And if I make that matrix of 486 rows by padding extra zeros, it gives incorrect output even though that test matrix is a part of trainig matrix.
Here is my code:
[Pr,Pc] = size(PP);% Pr=486, Pc=1200
TP=eye(6,1200);[Tr,Tc] = size(TP);L1 = 0.5*Pc;net0to9 = newff(minmax(PP),[L1 Tr],{'logsig' 'logsig'},'traingdx');net0to9.performFcn = 'mse'; net0to9.trainParam.goal = 0; net0to9.trainParam.show = 20; net0to9.trainParam.epochs =1200;[net0to9,Tr] = train(net0to9,PP,TP);x = sim(net0to9,PP);
I'd be really thankful if anyone could help.
Best Answer