Take absolute value (or modulus) of ordinate.
g=abs(f)
This function replaces all ordinate values of f with their absolute value (if f is real-valued) or modulus (if f is complex-valued). If f is complex-valued, its OrdinateType attribute will be tagged as real.