MATLAB: How to reshape (digitTrain4DArrayData) inbuilt number dataset provided in MATLAB

reshape 4d array

digitTrain4DArrayData data set is having dimension of 28 * 28 * 1 * 5000 (5000 samples) . How can we reshape it into 784 * 5000, to train it using neural network pattern recognizer in matlab for ANN.

Best Answer

[XTrain,YTrain] = digitTrain4DArrayData;
Use the reshape function as follows:
reshapedXTrain = reshape(XTrain,784,5000);
Related Question