My data set consists of 4 input variables, and 1 target variable with 5 categories. My input and target variables are the same length (~2000 values each). I followed the tutorials with the Pattern Recognition Neural Network, and then used my data in the network with okay results. I would like to use the network to predict the next 5-20 values, but having trouble. When I use the 'sim' function, I get a matrix the size of my target (5×2200) instead of the desired size of my prediction (5×20). How do I correct the prediction error?

`% Load INPUT and TARGET`

Load data.mat % Contains 'inputs' & 'targets' variables

% Create a Pattern Recognition Network

hiddenLayerSize = 17;net = patternnet(hiddenLayerSize);% Set up Division of Data for Training, Validation, Testing

net.divideParam.trainRatio = 70/100;net.divideParam.valRatio = 15/100;net.divideParam.testRatio = 15/100;% Train the Network

[net,tr] = train(net,inputs,targets);% Test the Network

outputs = net(inputs);errors = gsubtract(targets,outputs);performance = perform(net,targets,outputs);% Predict next 20 values

y = sim(net,inputs);

Any help is greatly appreciated!

Thanks,

Dan

## Best Answer