MATLAB: Problem using NARX NN time series tool

Deep Learning Toolboxneural networkstime series

Hi I have an input matrix of order nx2 my target matrix is nx1 i have taken delay d as 2; after training the NN and saving it we get a MATLAB object(net).
Now i am using the following command to predict the next value: Ypred = sim(net,xdata')';
it is showing following error ??? Error using ==> network.sim at 121 Number of inputs does not match net.numInputs.
can any one please tell me what input should i give to get the solution

Best Answer

[ I N ] = size(Input)
[ O N ] = size(Output)
P.S. posting the code in question generally gets faster answers than trying to explain in words. Ideally, use both
Hope this helps.
Thank you for formally accepting my answer
Greg