MATLAB: Does the Neural Network Pattern Recognition Tool GUI not list the workspace variable for target data in Neural Network Toolbox 7.0.3 (R2012a)

Deep Learning Toolboxnprtoolpatternrecognitiontargets

I have two workspace variables, a and b as follows
a=rand(10,200);
b=rand(1,200);
When I launch the NPRTOOL, I can see the workspace variables in "Inputs" but not for "Targets". I tried to import the variable as a MAT file but it still does not show up as a variable to select.

Best Answer

The target variable for Neural Network Pattern Recognition Tool in Neural Network Toolbox 7.0.3 (R2012a) needs to be a matrix of ones or zeros indicating which class the corresponding input belongs to. For example, the variable could be as follows:
>> target_var=[ 1 0 0 0;
0 0 1 0;
0 1 0 1];
where first column represents class 1; second column means class 3, and so on.
In case you need to convert your already defined class matrix (one-
dimensional) to a matrix of appropriate ones and zeros, you can do it as follows:
>> ind = [1 3 2 3] ;
>> vec = ind2vec(ind) ;
>> target_var = full(vec)
ans =
1 0 0 0
0 0 1 0
0 1 0 1
which you can then use as variable for your "Targets".
You can also have a look at the variables which were used in the Example Data Sets. Please click "Load Example Data Set". The Pattern Recognition Data Set Chooser window opens. Choose a data set, for example. "Breast Cancer", and click Import. You can then view these variables in the workspace.