I’m not very clear about the question you asked but I understand you need to find Chi-square value and reduced Chi-square value.
Formula for finding the Chi-square value is:
![chi-square.jfif](https://www.mathworks.com/matlabcentral/answers/uploaded_files/207515/chi-square.jpeg)
h = chi2gof(x)
You can find reduced Chi-square value through dividing the Chi-square value by degrees of freedom.
I hope this helps.