Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- %%
- % Name: Rachel Mock
- % Assignment: 2
- % Section: 1
- %
- %function random0
- function ran = random0(n, m)
- global ISEED
- if (nargin == 1)
- m = n;
- end
- for ii = 1:n
- for jj = 1:m
- ISEED = mod(8121 * ISEED + 28411, 134456);
- ran(ii, jj) = (ISEED / 134456);
- end
- end
- end
- %%
- % Name: Rachel Mock
- % Assignment: 2
- % Section: 1
- %
- %function seed
- function seed(new)
- global ISEED
- new = round(new);
- ISEED = abs(new);
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement