% LMcs100502_4th.m
observed=[24 8 13; 8 13 11; 10 9 64]
[p,cs,expected] = contincy(observed, 'chi2')
[r,c]=size(observed);df=(r-1)*(c-1);
criticalval=chi2inv(.95,df)
if chi2>criticalval
    disp('Reject Ho')
else
    disp('Fail to reject Ho')
end