MATLAB: Laplacian edge operator

MATLAB

i coded up Laplacian edge operator using MFC c++ .. now i want to varify the result using matlab..
Laplacian Operator and Campass Gradient Operator: result is given below website: http://imm.io/626r
I used Prewitt for Compass Gradeint Operator … How can i apply this in matlab ?
how can i apply laplacian operator in maltab.. is there any function for that ? i need a sample or example for laplacian operator in matlab.. any one can help me please ?
Thanks in Advace

Best Answer

I assume that the mask you applied in C++ was
0 -1 0
-1 4 -1
0 -1 0
and not what you gave in your comment to Oleg's reply.
If that's the case, then all you'd need to do in Matlab is to call the conv2 function, something like this:
mask = [0 -1 0; -1 4 -1; 0 -1 0];
result = conv2(image, mask);
You may need to select the right option for what to do at the boundaries of the image, to match what you did in C++.