Various matrix as examples in neural network I have to train a feedforward neural network for pattern recognition in matlab. Each example has 4 matrices of the same size (e.g. $N$ x $K$). 
The form I know to enter the values to the network is to convert each matrix into a vector and enter each value of each matrix as a single feature.
But I would like to know how to tell the network (and if I have to tell the network) that the element $(i,j)$ of one matrix is related with the element $(i,j)$ of all the other matrices.
Thanks.
 A: So, the question you are asking is: "How do I tell the network that the values at the same position $(i,j)$ in different examples are related"?
Dontloo is answering the question: "How do I tell the network that values in the same example, at close positions are related, i.e. tell the network that $(i,j)$ is related to $(i-1,j)$, $(i+1,j)$, $(i,j+1)$, etc." For the second question, Dontloo is correct that convolutional neural networks are the way to go. However for the first question, the answer is much simpler: you don't really need to do anything. You just need to make sure that you feed $(i,j)$ into the same neuron of the neural network each time, and then everything works out. So if you vectorize the matrix, you for example need to make sure that you do that consistently row-wise or consistently column-wise and not mix that up. The neural network will then learn how to process each input value, and since each $(i,j)$ is supplied into the same input neuron each time, it will use the patterns it sees in the $(i,j)$ of different examples. So no need to do anything except keeping everything consistent
A: Instead of converting matrices into a single vector, you can follow the structure of convolutional neural networks for images, where the four matrices correspond to four input channels, and the elements of the same position are connected together by definition.
If you don't need the assumption that an element is also related with its neighbors, you can use 1*1 convolutional layers and then fully connected layers. 
If you don't need the assumption that common patterns are shared across different positions, you can remove/relax the parameter sharing scheme.
