It is because the if condition placed is wrong, and always fx3 is getting 0, therby making only a single point.
Updated the code to match what you are trying below:
fx3 = zeros(1,length(x));
xPositive = x(x>=0);
Hope this helps.