function [y]=replace(x,a,b)
%FUNCTION REPLACE finds all the elements of matrix X that are equal to A, and
%                 returns a matrix Y with A values replaced by B.
% [y]=replace(x,a,b)
% 
% r.p. signell 4-10-90
%
y=x;
ind=find(x==a);
if(length(ind)~=0),
  y(ind)=b*ones(1,length(ind));
end
