I am trying to figure out how to port del2 () function to matlab in C ++.
I have a couple of masks that I work with, those are also zeros, so I wrote the code liket his:
for(size_t i = 1 ; i < nmax-1 ; i++)
{
for(size_t j = 1 ; j < nmax-1 ; j++)
{
transmask[i*nmax+j] = .25*(posmask[(i+1)*nmax + j]+posmask[(i-1)*nmax+j]+posmask[i*nmax+(j+1)]+posmask[i*nmax+(j-1)]);
}
}
to calculate the internal points of the Laplacians. I think, according to some information in "doc del2" in matlab, the boundary conditions just use the available information to calculate, right? I think I just need to write cases for the boundary conditions in i, j = 0 and nmax
However, I would have thought that these values from the code I posted here would be correct for the internal points as they are, but it looks like the results of del2 are different!
I broke through the source del2, and I think that I am missing the Matlab wizard to figure out what happens with some code to calculate the interior