I want to numerically (with Matlab) solve Poisson's equation : $ \frac{\partial^2u}{\partial x^2} + \frac{\partial^2u}{\partial y^2} = f(x,y)$ On a rectangular domain using experimental data.
From experimental data let's say that I have a $ [1:m \times 1:n] $ matrix that represents the right hand side of the equation. From experimental data I have access to $ \nabla(u)$ which is also a $ [1:m \times 1:n] $ matrix.
My question is : Is it mathematically/physically correct to reduce my mesh to a size of $ [2:m-1 \times 2:n-1] $ and to take $ \nabla(u)(1,:) $, $ \nabla(u)(n,:)$, $ \nabla(u)(:,1)$, $ \nabla(u)(:,n)$ as my Neumann boundary conditions ? Or am I missing something ?