What would the target matrix to train Neural Network?

I'm new at Artificial Neural Network and I'm using MATLAB developing Facial expression recognition and There are six expressions ; I'm not able to understand about How to create a target matrix? My Question is if I have SampleMatrix containing samples rows*columns. While rows are the features and 29 columns represents a single sample I meant to say 29 columns belongs to the same class and If SampleMatrix dimensions are 21007*174. 174 columns because I have 6 classes 6*29=179 What would the target matrix?

Kindly Help me out! Thanks.

• Can you please clarify your question? What sort of application are you working with? How does 29 becomes 174? What are the features? What are the classes? – A_A Feb 6 '17 at 0:13
• working on facial expression recognition system I have computed Eigenfaces of sample images, classes are the 6 expressions. 29 columns for single expression So for 6 expressions; 6 multiply by 29 =174 – Fahad Aslam Feb 6 '17 at 8:05

With these numbers, the input matrix would be a matrix of $30 \times 2000$, where each column $j$ is an example, and it has the 30 features of it. Hence, the position $(i,j)$ contains the feature $i$ of the example $j$.
The target matrix would be a matrix of $6\times 2000$. Where each column $j$ represents the correct class of the example $j$. The column is formed by zeros, and it has a $1$ at the row that indicates the class. If we have 6 classes, and the first example corresponds to class 3, the first column of the target matrix will be $[0 \ 0 \ 1\ 0\ 0\ 0]$. If the second example corresponds to class 5, the second column of the target matrix will be: $[0 \ 0 \ 0 \ 0 \ 1\ 0]$, and so on.