MATLAB: Check Positive or Negative Infinity

mathematicsMATLABstatistics

isinf function gives logical true in both cases whether infinity is postivie or negative but does not tell whether infinity is positive or negative. How can I check whether the infinity is positive or negative?
abc=-1*inf;
isinf(abc)

Best Answer

sign(abc) .* isinf(abc)