Step 1.Find an orthonormal basis for the subspace, e.g.

Step 2.In R^n, the projection onto the one-dimensional subspace spanned by a single unit vector has as its (i,j)-entry. So for example the projection onto the subspace spanned by is . Now do the same thing for the projection onto the subspace spanned by ½(1,1,1,1).

Step 3.If you have an orthonormal set of vectors then the projection onto the subspace spanned by them is the sum of the projections onto the one-dimensional subspaces spanned by the basis vectors. So the answer to the question is the sum of the two matrices from the previous paragraph.