dot(u,v) returns the dot product of vectors u and v.
norm(v) returns the length (not # of entries) of the vector v.
A=[A x] appends the vector x as a new column of A.
size(A,2) returns the number of columns of A.
A(:,j) indicates the jth column of A, and may be used for reading and writing.
If you like a bit of a programming challege and enjoy learning by trial and error, stop here and give it a try. If you get stuck, or just want to get the damn thing done ASAP, there are more detailed hints here.