Turn on thread page Beta
    • Thread Starter
    Offline

    5
    ReputationRep:
    How would i generate a 5x5matrix of random real numbers between the values 2 and 5.5?
    • Very Important Poster
    Online

    21
    ReputationRep:
    Very Important Poster
    (Original post by jlf98)
    How would i generate a 5x5matrix of random real intergers between the values 2 and 5.5?
    I would break this into two problems:

    1. Generating a random matrix. A quick google search shows that the rand function does this. You'd want rand(5) or rand(5,5) - both are the same.

    https://edoras.sdsu.edu/doc/matlab/t.../ref/rand.html

    2. Getting the numbers in this to be an integer between 2 and 5.5.

    The page above gives you a nice example in its explanation of the rand function, hint hint.
    You'd just need one more step after you've tried this (try it, see what you get in matlab and think of how to complete the function)
    Offline

    18
    ReputationRep:
    (Original post by jlf98)
    How would i generate a 5x5matrix of random real intergers between the values 2 and 5.5?
    (Original post by Kevin De Bruyne)
    2. Getting the numbers in this to be an integer between 2 and 5.5.
    I think we need to be questioning the very concept of a random integer between 2 and 5.5. (Obviously mathematically there's no problem, but the problem statement raises eyebrows, at the very least).
 
 
 
Reply
Submit reply
Turn on thread page Beta
Updated: October 23, 2017

University open days

  1. University of Bradford
    University-wide Postgraduate
    Wed, 25 Jul '18
  2. University of Buckingham
    Psychology Taster Tutorial Undergraduate
    Wed, 25 Jul '18
  3. Bournemouth University
    Clearing Campus Visit Undergraduate
    Wed, 1 Aug '18
Poll
How are you feeling in the run-up to Results Day 2018?
Useful resources

Make your revision easier

Maths

Maths Forum posting guidelines

Not sure where to post? Read the updated guidelines here

Equations

How to use LaTex

Writing equations the easy way

Student revising

Study habits of A* students

Top tips from students who have already aced their exams

Study Planner

Create your own Study Planner

Never miss a deadline again

Polling station sign

Thinking about a maths degree?

Chat with other maths applicants

Can you help? Study help unanswered threads

Groups associated with this forum:

View associated groups

The Student Room, Get Revising and Marked by Teachers are trading names of The Student Room Group Ltd.

Register Number: 04666380 (England and Wales), VAT No. 806 8067 22 Registered Office: International House, Queens Road, Brighton, BN1 3XE

Write a reply...
Reply
Hide
Reputation gems: You get these gems as you gain rep from other members for making good contributions and giving helpful advice.