Step 2:
clear;X=X';
D=D';
Create a network, and lets just give it one hidden layer with 10 nodes.
net = feedforwardnet(10); % One hidden layer with 10 nodes
Note that you don't have to specify the input and output number of nodes because Matlab automatically figures this out from the data when you train the network. Lets also just leave most of the default parameters of the network the same (no need to change the learning rule, or activation function, etc.).