Vectorizing equation in MATLAB
Is your question how to vectorize the equations for updating?  You have a vector of i and j, and for each update you are summing over j.  Calculate the vectors of each of the components and then sum the vector over j.

Providing actual code might help your question.  As is, it seems vague.