title: Computing Kolmogorov-Smirnov test in MATLAB
body: <p>I am using the <code>[h,p,ksstat,cv] = kstest(x,'cdf',y);</code> function in Matlab to  find the <code>ksstat</code> and p-value. My <code>x</code> is <code>x(1,1:10) = [0.16;1.21;4.41;0.09;0.64;0.36;0.04;6.76;0.04;0.49]</code>and my <code>y = chi2cdf(x,9);</code> which is the <code>cdf</code> I am specifying or testing. Although I get this error: </p>
  
  <pre><code>Error using kstest (line 160)
  Hypothesized CDF matrix must have 2 columns.
  </code></pre>
  
  <p>Normally I would have <code>[h,p,ksstat,cv] = kstest(x,'cdf',y);</code> where 
  <code>y = makedist('ChiSquared');</code> but as you may know the distribution Chi-squared does not exist so I am not sure how to get around this issue. Any suggestions are greatly appreciated.</p>