To address the dimension mismatch issue in your ANN prediction, ensure you scale your input and output separately using "mapminmax". 
[x2, PSx] = mapminmax(x'); % Transpose for compatibility 
[y2, PSy] = mapminmax(y'); % Transpose for compatibility 
% ANN Code to predict yPred2
% Reverse scaling of predicted output
yPred_rev = mapminmax('reverse', yPred2, PSy);
For more information on “mapminmax” you can type the following command in a MALTAB command window
doc mapminmax
Hope this helps.


