MATLAB: Why inputs and targets have diffrent sampels

importing excel dataneural network

why do i get this error? iam trying to train a neural network.80%of my data is training data and the rest is test.
Error using network/train (line 340)
Inputs and targets have different numbers of samples.
Error in Untitled3 (line 20)
net= train(net,set',t');
this is my code.
clc
clear all
close all
filename='FIFA2.xlsx';
A =xlsread(filename);
[m,n]=size(A);
T=A(:,1);
data=A(:,(2:end));
[m,n]=size(A);
rows=int32(floor(0.8 * m));
set=A(1:rows,:);
testset=A(rows+1:end,2:n);
t=set(1:rows);
t_test=testset(rows:end);
net= newff(set',t');
y=sim(net,set');
% net.trainParam.epoch=20;
net= train(net,set',t');
y=sim(net,set');
hardlims(y);

Best Answer

For I-dimensional "I"nputs and O-dimensional "O"utput targets
After reading in inputs and targets
ALWAYS CHECK THE DIMENSIONS !!!
[ I Ni ] = size(input)
[ O Nt ] = size(target)
if Nt == Ni
N = Ni
else
error
end
Hope this helps
Thank you for formally accepting my answer
Greg