I am looking for a way to generate a target matrix for the neural network toolbox using labeled data where each class is represented in an vector of integers.
Example:
X = [0 2 1 2 3]
I need this in the form
X = [ 1 0 0 0 0 0 1 0 0 1 0 0 0 0 1 0 0 0 0 1]
Is it possible to do this without a loop?
Thanks
Best Answer