title: input size error in neural network programming by MATLAB
body: <p>This is my code:</p>
  
  <pre><code>p = input1;
  t1 = output1;
  net = feedforwardnet(10, 'trainrp');
  net.trainParam.epochs = 1000;
  net.trainParam.goal = 0.0005;
  net = train(net, p, t1); 
  y1 = sim(net, p);
  p = input2;
  t2 = tar;
  y2 = sim(net, p);
  </code></pre>
  
  <p>However, I get this error:</p>
  
  <pre><code>error using bsxfun
  Non-singleton dimensions of the two input arrays must match each other.
  
  Error in nnMATLAB.pc (line 24)
  pi = bsxfun(@minus,pi,settings.xoffset);
  
  Error in nncalc.preCalcData (line 20)
  data.Pc = calcMode.pc(net,data.X,data.Xi,data.Q,data.TS,calcHints);
  
  Error in nncalc.setup1 (line 118)
  calcData =
  
  nncalc.preCalcData(matlabMode,matlabHints,net,data,doPc,doPd,calcHints.doFlattenTime);
  
  Error in network/sim (line 283)
  [calcMode,calcNet,calcData,calcHints,~,resourceText] = nncalc.setup1(calcMode,net,data);
  </code></pre>
  
  <p>I want to make a neural network which has input1 as input 310 x 24 matrix and output1 as output, 155 x 24 matrix.</p>
  
  <p>Also, I will train the network with input1 &amp; output1</p>
  
  <p>After this training process, I will use input2 as testing data, and I want to get a simulation result using above network which is trained by input1 &amp; output1 .</p>
  
  <p>In summary, I want to train my own network with input1 and output1, and I want to get my simulation result with input2.</p>
  
  <p>I think these errors are based on input size difference between training section and testing section.</p>
  
  <p>How can I solve this problem? Should I run additional process??</p>
  
  <p>I'm looking for your kind answer. </p>
  
  <p>Thank you.</p>