Compare feature vectors of an image in MATLAB
If you just need OCR to work, then please try the ocr function in the Computer Vision System Toolbox.

If you need to write your own, take a look at this example, showing how to train an SVM classifier using HOG features for recognizing hand-written digits.