x = [ 1 2 3 5
      2 4 6 8
      3 6 9 9 ]
[mx, nx] = size(x)
x0 = 2*x(1, :) - x(2, :)
xf = 2*x(mx, :) - x((mx-1), :)
xs = ([ x0; x ] + [ x; xf ])/2
x0 = 2*xs(:, 1) - xs(:, 2)
xf = 2*xs(:, nx) - xs(:, (nx-1))
xs = ([ x0 xs ] + [ xs xf ])/2
