- In your OpenCV code, you're mixing obsolete C syntax with C++ syntax. You should really avoid to do that.
- Your template image is bigger than the image itself. This won't work (you probably uploaded the wrong template).
In order to make it work, I used as reference image this:

and as template this:

This is the (correct) OpenCV code to use:
#include <opencv2\opencv.hpp>
using namespace cv;
int main()
{
Mat1b img = imread("path_to_image", IMREAD_GRAYSCALE);
Mat1b templ = imread("path_to_template", IMREAD_GRAYSCALE);
// Compute match
Mat result;
matchTemplate(img, templ, result, TM_CCORR_NORMED);
// Get best match
Point maxLoc;
double maxVal;
minMaxLoc(result, NULL, &maxVal, NULL, &maxLoc);
// Display result
Mat3b res;
cvtColor(img, res, COLOR_GRAY2BGR);
rectangle(res, Rect(maxLoc.x, maxLoc.y, templ.cols, templ.rows), Scalar(0, 255, 0));
imshow("Match", res);
waitKey();
return 0;
}
that produces this result:

This is the (correct) Matlab code to use:
temp = rgb2gray(imread('path_to_template'));
img = rgb2gray(imread('path_to_image'));
% Perform cross-correlation
c = normxcorr2(temp,img);
% Find peak in cross-correlation
[ypeak, xpeak] = find(c==max(c(:)));
% Account for the padding that normxcorr2 adds
yoffSet = ypeak-size(temp,1);
xoffSet = xpeak-size(temp,2);
% Displat matched area
hFig = figure;
hAx = axes;
imshow(img,'Parent', hAx);
imrect(hAx, [xoffSet, yoffSet, size(temp,2), size(temp,1)]);
that produces this result:

As you can see, the results are equivalent. The actual maximum number in the match result matrix is:
OpenCV: 0.99999815225601196
Matlab: 0.999988754172261
which we can consider as equal. The small difference is probably due to minor differences in the internal implementation, but is not relevant.