Training custom classifiers using trainCascadeObjectDetector
Check out this tutorial on how to use trainCascadeObjectDetector. It describes common pitfalls, and includes examples.

There is also a graphical tool for labeling training images on MATLAB Central, which makes preparing your training data much less painful.

By the way, the link you posted is actually the documentation for vision.CascadeObjectDetector, which uses the classifier produced by trainCascadeObjectDetector. The doc page for trainCascadeObjectDetector is here.