MATLAB Examples

Compute Chi-Square Distribution pdf

Compute the pdf of a chi-square distribution with 4 degrees of freedom.

x = 0:0.2:15;
y = chi2pdf(x,4);

Plot the pdf.

figure;
plot(x,y)

The chi-square distribution is skewed to the right, especially for few degrees of freedom.