08-Oct-2025 11:31:09 octave_random_test(): MATLAB/Octave version 6.4.0 Test random number generators. rand_test(): rand() generates uniform random values in [0,1]. rand_test01(): In MATLAB, unit random numbers are generated by calling rand(): A = rand ( ) a random scalar value. B = rand ( 5, 1 ) a random column vector of 5 entries. C = rand ( 1, 5 ) a random row vector of 5 entries. D = rand ( 3, 4 ) a 3 by 4 random matrix. E = rand ( 5 ) a 5 by 5 random matrix. a = 0.7127 b = 0.741062 0.569891 0.071436 0.717215 0.638283 c = 0.9866 0.9279 0.4861 0.4181 0.7218 d = 0.595862 0.062417 0.020860 0.977801 0.988777 0.269089 0.688800 0.971854 0.432826 0.063908 0.152863 0.417361 e = 0.380254 0.852314 0.457865 0.647656 0.291417 0.628975 0.015534 0.303549 0.618759 0.707752 0.339364 0.704596 0.280741 0.203966 0.440264 0.915875 0.700510 0.777364 0.767972 0.493499 0.944028 0.552379 0.639320 0.517745 0.552016 rand_test02(): By setting the random number key, you can control how the random number sequence begins. This is NOT implemented on Octave! rand_test02(): By setting the random number key, you can control how the random number sequence begins. This is NOT implemented on Octave! rand_test02(): By setting the random number key, you can control how the random number sequence begins. This is NOT implemented on Octave! rand_test03(): Compute a lot of random values. The average should be 0.5 The variance should be 1/12. N Ave Ave-1/2 Var Var-1/12 1 0.687035 1.87e-01 0.000000 -8.33e-02 10 0.601899 1.02e-01 0.079589 -3.74e-03 100 0.553801 5.38e-02 0.079155 -4.18e-03 1000 0.492038 -7.96e-03 0.082895 -4.38e-04 10000 0.497278 -2.72e-03 0.081738 -1.60e-03 100000 0.499671 -3.29e-04 0.083772 4.39e-04 1000000 0.500031 3.11e-05 0.083413 7.94e-05 10000000 0.499982 -1.77e-05 0.083345 1.16e-05 rand_test(): Normal end of execution. randi_test(): randi() generates random integers. randi_test01(): In MATLAB, random integers are generated by calling randi(): The maximum value is specified as IMAX. A = randi ( imax, 1, 1 ) a random scalar value between 1 and IMAX. B = randi ( imax, 5, 1 ) a random column vector of 5 entries. C = randi ( imax, 1, 5 ) a random row vector of 5 entries. D = randi ( imax, 3, 4 ) a 3 by 4 random matrix. E = randi ( imax, 5, 5 ) a 5 by 5 random matrix. a = 2 b = 4 4 2 3 9 c = 9 2 9 3 7 d = 1 4 3 2 3 3 2 3 1 2 3 1 e = 4 2 3 3 1 3 4 3 4 4 2 3 2 3 4 1 2 4 4 2 3 3 4 3 2 randi_test02(): randi() allows the user to specify the numeric range. A = randi ( [ 5, 10 ], 1, 1 ) a random scalar value. B = randi ( [ 7, 8 ], 10, 1 ) a random column vector of 5 entries. C = randi ( [ -1, +1 ], 1, 5 ) a random row vector of 5 entries. D = randi ( [ -5, +5 ], 3, 4 ) a 3 by 4 random matrix. E = randi ( [ 100, 200 ], 5, 5 ) a 5 by 5 random matrix. a = 5 b = 7 7 7 7 7 7 7 7 8 7 c = -1 1 -1 0 1 d = 0 -3 -3 -5 -3 5 3 -5 3 -3 -1 -5 e = 107 177 193 103 185 189 175 163 160 129 157 170 169 198 186 117 165 169 121 185 161 106 109 174 193 randi_test03(): By setting the random number key, you can control how the random number sequence begins. This is NOT implemented in Octave. randi_test03(): By setting the random number key, you can control how the random number sequence begins. This is NOT implemented in Octave. randi_test03(): By setting the random number key, you can control how the random number sequence begins. This is NOT implemented in Octave. randi_test(): Normal end of execution. randn_test(): randn() generates normally distributed random numbers. randn_test01(): In MATLAB, normal random numbers are generated by calling randn(): A = randn ( ) a random scalar value. B = randn ( 5, 1 ) a random column vector of 5 entries. C = randn ( 1, 5 ) a random row vector of 5 entries. D = randn ( 3, 4 ) a 3 by 4 random matrix. E = randn ( 5 ) a 5 by 5 random matrix. a = -0.7627 b = -0.4056 -0.2813 -0.9640 -1.0710 -0.7559 c = 1.3726 0.2525 0.1067 -0.1594 -1.9939 d = -0.064631 0.357128 -0.525805 -0.698941 -0.262345 -1.299317 0.252227 -0.245822 -0.467413 0.047910 -1.439834 1.272870 e = -3.5974e-01 -5.7523e-03 -7.3291e-01 9.0021e-01 3.4532e-01 -1.7153e+00 -4.2321e-01 -1.1324e-01 5.1724e-01 6.1847e-01 8.4329e-02 -2.3632e-03 8.7235e-01 -4.8146e-01 -2.4035e+00 1.7042e-01 6.8172e-01 -8.5473e-01 9.9525e-01 1.0999e+00 1.3690e+00 1.1186e+00 4.6468e-01 1.4374e-01 -1.1632e-01 randn_test02(): By setting the random number key, you can control how the random number sequence begins. This is NOT implemented in Octave. randn_test02(): By setting the random number key, you can control how the random number sequence begins. This is NOT implemented in Octave. randn_test02(): By setting the random number key, you can control how the random number sequence begins. This is NOT implemented in Octave. randn_test03(): Compute a lot of random values. The average should be 0.0 The variance should be 1. N Ave Var 1 0.577589 0.000000 10 -0.232169 1.301602 100 -0.062990 1.181645 1000 0.034529 0.935195 10000 -0.003166 0.993203 100000 0.004985 1.000209 1000000 -0.001206 1.001989 10000000 0.000324 0.999724 randn_test(): Normal end of execution. rng_test(): Test the random number function rng(). rng_test01(): Call rand() with no initialization: 1 0.0640844 2 0.864888 3 0.559796 4 0.290603 5 0.465979 rng_test01(): Call rand() with no initialization: 1 0.97992 2 0.407331 3 0.0767098 4 0.663008 5 0.0937213 rng_test01(): Call rand() with no initialization: 1 0.0272922 2 0.159298 3 0.840748 4 0.366483 5 0.407134 rng_test01(): Call rand() with no initialization: 1 0.243888 2 0.393626 3 0.702419 4 0.606478 5 0.0724085 rng_test01(): Call rand() with no initialization: 1 0.319282 2 0.990581 3 0.438031 4 0.90989 5 0.308624 Skip remaining tests, since rng() is not fully implemented in Octave. octave_random_test(): Normal end of execution. 08-Oct-2025 11:31:09