|
"Jennifer Faggi Renault" <asma_192@live.fr> wrote in message <hpcs1n$38u$1@fred.mathworks.com>...
> Hello all,
> i want to randomly select 1000 pairs of two adjacent pixels from an image to calculate their correlation coefficicent after that.
> Can any one help me please cause i'm stuck here for along !!
> and thanks in advance
one of the solutions
img=magic(4);
np=4; % <- #pairs to select...
nr=size(img,1);
rp=randperm(numel(img)-nr);
rp=rp(1:np);
plst=[img(rp).',img(rp+nr).']
%{
% plst = % <- based on current RAND state...
10 8
4 14
2 3
5 11
%}
us
|