MATLAB: Generate column of random numbers that change slowly from row to row

random number generator

I have basic code here that generates pseudorandom numbers from 0.2 to 0.8, 200 times.
T = 200;
prob = 0.2+0.8*rand(T,2); % 200x2 double of random numbers
I want to adapt this code to constrain the number generated somehow so that they do not deviate much from row to row. In other words, I want each number to gradually change as the rows continue. For example:
0.5239 0.7115
0.4636 0.7117
0.5127 0.7214
0.4790 0.6998
0.4762 0.6944
0.5071 0.6777
As opposed to currently where the changes from row to row are quite dramatic:
0.945807614921516 0.378485320607502
0.414444310039899 0.894364308664596
0.375143552399965 0.609302224704160
0.745332926293388 0.429105784162042
0.781003750944333 0.991048513739670
Any help is much appreciated, thank you!

Best Answer

You might generate the random points as you have but then smooth them with the smooth or filter function, e.g.,
sprob = zeros(size(prob));
sprob(:,1) = smooth(prob(:,1));
sprob(:,2) = smooth(prob(:,2));
The sprob values will change more slowly, so perhaps those would give you what you want.