The reason why I got the error message mentioned above is because the page is for R2014a,but my MATLAB is R2012b,so it is a version problem. We just need to change the code like this:
[fMatrix, epipolarInliers, status] = estimateFundamentalMatrix(matchedPoints1.Location, ...
matchedPoints2.Location, 'Method', 'RANSAC', 'NumTrials', 10000, 'DistanceThreshold', ...
0.1, 'Confidence', 99.99);