How would i generate a 5x5matrix of random real numbers between the values 2 and 5.5?
Turn on thread page Beta
How to generate a random matrix using matlab? watch
- Thread Starter
Last edited by jlf98; 25-10-2017 at 11:39.
- 22-10-2017 16:12
Online21ReputationRep:Very Important Poster
- Very Important Poster
- 23-10-2017 01:14
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.
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)
- 23-10-2017 10:37