Advertisement
Guest User

Untitled

a guest
May 4th, 2015
254
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MatLab 0.49 KB | None | 0 0
  1. %%
  2. % Name: Rachel Mock
  3. % Assignment: 2
  4. % Section: 1
  5. %
  6.  
  7. %function random0
  8. function ran = random0(n, m)
  9.     global ISEED
  10.         if (nargin == 1)
  11.             m = n;
  12.         end
  13.     for ii = 1:n
  14.             for jj = 1:m
  15.                 ISEED = mod(8121 * ISEED + 28411, 134456);
  16.                 ran(ii, jj) = (ISEED / 134456);
  17.             end
  18.     end        
  19. end
  20.  
  21.  
  22. %%
  23. % Name: Rachel Mock
  24. % Assignment: 2
  25. % Section: 1
  26. %
  27.  
  28.  
  29. %function seed
  30.  
  31. function seed(new)
  32.     global ISEED
  33.     new = round(new);
  34.     ISEED = abs(new);
  35. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement