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!

MATLAB trouble with reshape and random matricies

  1. Jun 16, 2013 #1
    I am trying to learn MATLAB with MIT OCW and I am running into some trouble.

    It says as an assignment:

    c. cMat = a 10x10 matrix where the vector 1:100 runs down the columns (use reshape).


    1 11 21.....91
    . ..............

    is the matrix I am trying to make and another exercise says

    f. Make fMat be a 5x3 matrix of random integers with values on the range -3 to 3 (use rand and floor or ceil)

    I am not sure how it wants me to go about these, thanks for any help. The course link is listed below.

  2. jcsd
  3. Jun 18, 2013 #2
  4. Jun 21, 2013 #3
    Figured it out. It took me a while though, sadly.

    for c. I used

    cMat= linspace(1, 100)
    cMat= reshape(cMat,10, 10)

    and d. I used

    fMat= ceil(rand(5,3)*10);
    mod(fMat, 4)

    And I really appreciate the help I am learning it through the MIT slides alone, I find I get hung up on little things like this.
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Similar Discussions: MATLAB trouble with reshape and random matricies
  1. Calculator trouble (Replies: 3)

  2. Matlab @ (Replies: 1)

  3. Mathematica Trouble (Replies: 2)