The error you are facing is because the second argument to the "extractHOGFeatures" function must be a center location point of a square neighbourhood. The function extracts descriptors from the neighborhoods that are fully contained within the image boundary.
Please refer to the below code on how to extract the HOG features.
img = imread('cameraman.tif');
[featureVector,hogVisualization] = extractHOGFeatures(img);
If you want to use extract the HOG features around a certain point, please refer to the below code.
I2 = imread('gantrycrane.png');
corners = detectFASTFeatures(im2gray(I2));
strongest = selectStrongest(corners,3);
[hog2,validPoints,ptVis] = extractHOGFeatures(I2,strongest);
For more information on "extractHOGFeatures", please refer to the below documentation link. It also contains different examples which you can refer regarding different input arguments.
Hope you find this information helpful!