% A sample function (even)
%
% Samuli Siltanen Nov 2014

function result = MyFun1(x)

result = ones(size(x));

index = (x>pi/2)&(x<3*pi/2);

result(index) = -1;