function out=f(x) % % generates the values of the piecewise function f(x) for j=1:length(x) if(x(j)<0) out(j)=0; elseif(x(j)>=0) out(j)=1; end end