MATLAB: Do I receive a syntax error when I try to run the second example from the documentation page for PROBPLOT in the Statistics Toolbox 6.1 (R2007b)

Statistics and Machine Learning Toolbox

When I try to execute the code in the second example from the documentation page for PROBPLOT, I receive the following error
??? h = probplot(gca,@(data,mu,sig,df))
Error: Unbalanced or unexpected parenthesis or bracket.

Best Answer

This typographical error has been fixed in the documentation of Statistics Toolbox 6.2 (R2008a). For previous product releases, read below for any possible workarounds:
There is a typographical error in the documentation for the Statistics Toolbox 6.1 (R2007b) PROBPLOT Function Reference, Example 2. The document may be opened by executing 'web([docroot,'/toolbox/stats/probplot.html'])' at the MATLAB command prompt. The corrected code to generate the plot shown in Example 2 is:
left_tail = -exprnd(1,10,1);
right_tail = exprnd(5,10,1);
center = randn(80,1);
data = [left_tail;center;right_tail];
probplot(data);
p = mle(data,'dist','tlo');
t = @(data,mu,sig,df)cdf('tlocationscale',data,mu,sig,df);
h = probplot(gca,t,p);
set(h,'color','r','linestyle','-')
title('{\bf Probability Plot}')
legend('Data','Normal','t','Location','NW')