MATLAB: Use multidimensional (n>2) array as input for train

clusteringDeep Learning Toolboxmultidimensionalneural networkstatisticsStatistics and Machine Learning Toolboxunsupervised

I would like to train a neural network for unsupervised clustering. I have 35 samples. Each sample is a 2-dimensional uint8-array, i.e. "input" is a < 35x1440x19 uint8 > array.
Using the sample from the "train" documentation I get:
% Create a Self-Organizing Map
dimension1 = 10;
dimension2 = 10;
net = selforgmap([dimension1 dimension2]);
% Train the Network
[net,tr] = train(net,input);
Error using nntraining.setup (line 13)
Inputs X is not two-dimensional.
Error in network/train (line 247)
[net,data,tr,err] = nntraining.setup(net,net.trainFcn,X,Xi,Ai,T,EW,true);
How do I convert "input" into a variable which "train" will accept? Any help would be appreciated.

Best Answer

1. Convert the data to format long
2. Use PCA feature extraction to reduce IROW = 1440 to irow << IROW
3. Columnize using (:) to get I = 19*irow for the N = 35 examples
4. Nomenclature: The 35 examples constitute one sample