The input data for training classical neural networks is expected to be an R x Q dimensional matrix (or a cell array of R x Q matrices), where Q is the batch size or number of observations and R is the number of variables.
Since ‘patternnets’ (in general, not just in MATLAB) do not take account of spatial dependencies between variables (as opposed to convolutional deep learning networks) you could try to work around this requirement by reshaping the data from a 2D matrix into a 1D vector. For example:
Instead of:
inputs = rand(3,3,10)
targets = ones(2,10);
You could use:
inputs = rand(9,10);
targets = ones(2,10);
However, depending on what your 2-D data represents, a better alternative might be to work with convolutional neural networks (CNNs). These networks are designed to model spatial dependencies between variables/features and are the state-of-the-art for tasks such as image classification.
Please see here how to create a simple classification deep learning network for 2-D image data:
Best Answer