FORALL (I = 2:N-1, J = 2:N-1)

& U(I, J) = 0.25 * (U(I, J-1) + U(I, J+1) +

& U(I-1, J) + U(I+1, J))

## Can be recast in terms of array assignment:

U(2:N-1, 2:N-1) =

& 0.25 * (U(2:N-1, 1:N-2) + U(2:N-1, 3:N)

& + U(1:N-2, 2:N-1) + U(3:N, 2:N-1))

Previous slide | Next slide | Back to first slide | View graphic version |