% Regression test function (black blox) for FreeMat v3.5 % This function is autogenerated by helpgen. function bbtest_success = bbtest_randn bbtest_success = 1; NumErrors = 0; try randn(2,2,2) catch NumErrors = NumErrors + 1; end if (NumErrors ~= 0) bbtest_success = 0; return; end NumErrors = 0; try randn([2,2,2]) catch NumErrors = NumErrors + 1; end if (NumErrors ~= 0) bbtest_success = 0; return; end NumErrors = 0; try x = 10+sqrt(5)*randn(1,10000); catch NumErrors = NumErrors + 1; end try mean(x) catch NumErrors = NumErrors + 1; end try var(x) catch NumErrors = NumErrors + 1; end if (NumErrors ~= 0) bbtest_success = 0; return; end NumErrors = 0; try randn('state',0) % restores us to startup conditions catch NumErrors = NumErrors + 1; end try a = randn(1,3) % random sequence 1 catch NumErrors = NumErrors + 1; end try b = randn('state'); % capture the state vector catch NumErrors = NumErrors + 1; end try c = randn(1,3) % random sequence 2 catch NumErrors = NumErrors + 1; end try randn('state',b); % restart the random generator so... catch NumErrors = NumErrors + 1; end try c = randn(1,3) % we get random sequence 2 again catch NumErrors = NumErrors + 1; end if (NumErrors ~= 0) bbtest_success = 0; return; end