repeat_count = 10000;
my_data(repeat_count) = struct('pks', , 'loc', );
for count = 1 : repeat_count
v = zeros(1, n);
[my_data(count).pks, my_data(count).loc] = findpeaks(real(fft(v)),'npeaks',10);
Note: if you want 10 peaks out of 20 points. then you will need to select index 2 through 11 from the fft result.
Selecting peaks from the entire fft result is not the right thing to do because fft of real data returns complex conjugate data symmetric around the middle of the output.
Because peak selection requires that the point before and the point after be less than or equal to the current point, the maximum number of peaks that can be located is half of the input size -- and if you are going for that many you might as well just take every second point.
Effectively the maximum number of peaks you can find from real(fft(v)) is length(v)/4, and you should probably be aiming for less than that.