Step 1:
The first line of the program should show that it will be a function, and what input and output variables it will use.
function [W1, W2] = BackpropXOR(W1,W2,X,D);
where
W1 are the set of weights associated with the connections between
the input layer and the hidden layer, and W2 are the set of weights
associated with the connections between the hidden layer and the output
layer.
X is the input matrix (first two columns of the "truth table".
D is the correct answer matrix (column 3 of the table).
lets also set the "learning rate", a value typically between 0 and 1.
alpha=0.9; %learning rate