how to generate random data
Show older comments
number of data = 1000; dimension=20; and save in mat format.
5 Comments
jgg
on 7 Jan 2016
What kind of randomness do you want? There are many ways to generate a random variable. For instance, rand(1000,20) will give you a matrix of the desired size that is uniformly distributed on 0 to 1.
Image Analyst
on 7 Jan 2016
What do you mean by dimension=20? Do you mean it's a 1-D vector with a length of 20 elements or 1000 elements, or do you mean a 20-D array with 1000 length of each dimension (in which case you won't have enough memory)?
If you want this:
data = rand(1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000);
then you can't have that and you most likely don't need that.
jgg
on 7 Jan 2016
I'm not sure what you mean? What kind of labels do you want assigned?
the cyclist
on 7 Jan 2016
How about this, fred? Spend the time to compose a complete, coherent description of what it is that you want as input and output from your program. This isn't twitter; feel free to use more than 140 characters.
Accepted Answer
More Answers (0)
Categories
Find more on Random Number Generation in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!