I am trying to randomly access a file from a folder using matlab. Could you suggest how to go about it? I am planning to use randn
function, but i don't understand how.
I think you need a random number with uniform distribution, not normal. So here you go ..
Files = dir('MyFolder');
N = size(Files,1) - 2;
rand = randi(N,1);
Random_filename = Files(rand+2,1).name;