The error message is very clear, you're trying to add two matrices of different size, which is never possible. Since b1 is a 1xh vector, Train1*W1 must be a 1xh vector, and since W1 is a Dxh matrix, Train1 must be a 1xD vector for the product to be 1xh.
Therefore, your train1 is not 1xD. There is nothing we can do about that. Either use a train1 matrix that is 1xD or change your D to reflect the size of train1.
Note that it is never a good idea to hardcode the size of matrices. It is always safer to ask matlab for the actually size:
would ensure it always match train1. Of course, train1 must only have one row.
edit: got confused between D and h but see comment below.