% Regression test function (black blox) for FreeMat v4.0
% This function is autogenerated by helpgen.
function bbtest_success = bbtest_randchi
  bbtest_success = 1;
NumErrors = 0;
try
  f = zeros(7,100);

catch
  NumErrors = NumErrors + 1;
end
try
  x = (1:100)/10;

catch
  NumErrors = NumErrors + 1;
end
try
  for n=1:7;t=x.^(n/2-1).*exp(-x/2);f(n,:)=10*t/sum(t);end

catch
  NumErrors = NumErrors + 1;
end
try
  plot(x,f');

catch
  NumErrors = NumErrors + 1;
end
try
  mprint chipdf

catch
  NumErrors = NumErrors + 1;
end
if (NumErrors ~= 0) bbtest_success = 0; return; end
NumErrors = 0;
try
  randchi(4*ones(1,6))

catch
  NumErrors = NumErrors + 1;
end
try
  sum(randn(4,6).^2)

catch
  NumErrors = NumErrors + 1;
end
if (NumErrors ~= 0) bbtest_success = 0; return; end
