%compareSim.m
function response = CompareSim(W, ResTest, M)
% response = COMPARESIM(W, Wtest, M) compares the sim between W and
% M-1 random vector of the same size. 
% The value of ResTest is located in the M/2 place.
% This function must show a peak if W was present in the image

if (nargin<2)
   error('Se necesitan más parámetros')
end
if (nargin == 2)
   M = 500;
end

[s1 N]=size(W);
for i = 1:M
   if (i == floor(M / 2))
      aux=ResTest;     
   else
      X = randn(1,N);
      aux=similar(W, X);
   end
   response(i) = aux;
end
