Faulty notation. Typical usage is input x, target t, output y . See the documentation examples for the regression/curve-fitting function FITNET.
See PATTERNNET for classification/pattern-recognition documentation examples.
Both functions call FEEDFORWARDNET which never has to be explicitly used.
help fitnet
doc fitnet
[x, t] = simplefit_dataset;
net = fitnet(10);
net = train(net,x,t);
view(net)
y = net(x);
perf = perform(net,t,y)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% An expanded modification. Search the NEWSGROUP and ANSWERS using
% Ending semicolons removed from selected commands so that results are automatically printed to the screen
[ x, t ] = simplefit_data;
[ I N ] = size(x)
[ O N ] = size(t)
figure(1)
plot(x,t)
% MATLAB Default trn/val/tst data division ratio is 0.7/0.15/0.15
Ntrn = N-2*round(0.15*N)
Ntrneq = Ntrn*O
net = fitnet;
Nw = (I+1)*H+(H+1)*O
[ net tr y e ] = train(net,x,t);
NMSE = mse(e)/var(t,1)
R2 = 1 -NMSE
Hope this helps.
Thank you for formally accepting my answer
Greg % See Wikipedia/Rsquared
Best Answer