Generalized Richardson iterative method matlab programming