Machine learning assignment 4

This commit is contained in:
2017-05-16 22:11:33 +01:00
parent 18453d2e37
commit a9cee6e867
18 changed files with 246 additions and 0 deletions

View File

@@ -0,0 +1,9 @@
function ret = a4_rand(requested_size, seed)
global randomness_source
start_i = mod(round(seed), round(size(randomness_source, 2) / 10)) + 1;
if start_i + prod(requested_size) >= size(randomness_source, 2) + 1,
error('a4_rand failed to generate an array of that size (too big)')
end
ret = reshape(randomness_source(start_i : start_i+prod(requested_size)-1), requested_size);
end