% Example 1D signal for the 2015 Inverse Problems course
% We assume that the evaluation points are in the 
% interval [0,1]

function result = target1(x)

% if ~isempty(find(x<0 | x>1))
%     error('evaluation points should be in the interval [0,1]')
% end

% Initialize 
result = zeros(size(x));

% Piecewise definition
% Spikes in a "comb" formation
result((x>0.05)&(x<0.06)) = 1;
result((x>0.07)&(x<0.08)) = 1;
result((x>0.09)&(x<0.10)) = 1;
% A smooth portion
ind1         = (x>0.2)&(x<0.4);
result(ind1) = (1+sin(-pi+2*pi*(x(ind1)-.2)/(.2)))/2;
% A triangle
ind2         = (x>0.5)&(x<0.7);
ind3         = (x>0.7)&(x<0.9);
result(ind2) = 3*(x(ind2)-0.5);
result(ind3) = 3*(-x(ind3)+0.9);






