below is a sub section of my codes for load forecasting using 10 fold cross validation technique.Every runs fine,but the testTargets and trainPerformance showing NaN instead of real numbers? please can some help me with the codes to calculate MAE,RMSE and MAPE for this code sample?
for i=1:k
[net,tr]=train(net,trainMatrix{i}(:,1:4)',trainMatrix{i}(:,5)');
outputp=net(trainMatrix{i}(:,1:4)');
errors=gsubtract(trainMatrix{i}(:,5)',outputp);
performance=perform(net,trainMatrix{i}(:,5)',outputp);
trainTargets = trainMatrix{i}(:,5)'.*tr.trainMask{1};
testTargets = trainMatrix{i}(:,5)' .*tr.testMask{1};
trainPerformance = perform(net,trainTargets,outputp);
testPerformance = perform(net,testTargets,outputp);
test(k)=testPerformance;
outputnout=mapminmax('reverse',outputp,TS);
end