Reputation: 654
I need to generate a fixed number images randomly from a file in matlab. For this do i need to first convert the images into vectors or can i use a random function on the images directly?
So for example, i need 15*N images for testing, where lets say N=3. I have 165 images so 45 images will be my training set. Is there any built in matlab function to generate random images from a file?
Upvotes: 0
Views: 2150
Reputation: 2364
I think you mean you want a random sample of images.
Use the randsample command from matlab to select random image indexes and then load those. http://www.mathworks.com/help/stats/randsample.html
Upvotes: 1