1. Limited time only! Sign up for a free 30min personal tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Homework Help: MATLAB Simple Randomization

  1. Mar 14, 2014 #1
    1. The problem statement, all variables and given/known data

    Enter the following two commands, and copy and paste the output as your answer
    > rand("state",student_number0917);
    > rand(1)
    where student_number0917 is your student number with "0917" at the end and with "-" removed.
    For example, if your student number is 123-456-7, you would enter
    > rand("state",12345670917);
    > rand(1)

    The problem is, we need to do this for each new assignment, and for each new assignment, we append a new number: 0917 (in this instance), then 0913, 0920, 0911 etc.

    However, I always get the same result, no matter what number I append?
    Am I missing something?

    2. Relevant equations

    > rand("state",1234567????);
    > rand(1)

    3. The attempt at a solution

    >> clc; clear;
    >> rand('state',312754190917)
    >> rand(1)

    ans =



    >> clc; clear;
    >> rand('state',312754190913)
    >> rand(1)

    ans =

  2. jcsd
  3. Mar 14, 2014 #2


    User Avatar
    Science Advisor
    Homework Helper
    Gold Member

  4. Mar 15, 2014 #3
    Yeah, that is the exact version I am using . . . cool, will look into it!
    I have emailed my Prof. (included your post) :)

Share this great discussion with others via Reddit, Google+, Twitter, or Facebook

Have something to add?
Draft saved Draft deleted