MATLAB Answers

0

Check Positive or Negative Infinity

Asked by Imran Kanjoo on 24 Jun 2019 at 13:26
Latest activity Edited by Imran Kanjoo on 24 Jun 2019 at 16:00
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)

  0 Comments

Sign in to comment.

Products


Release

R2018b

2 Answers

Answer by madhan ravi
on 24 Jun 2019 at 13:36
Edited by madhan ravi
on 24 Jun 2019 at 13:52
 Accepted Answer

sign(abc) .* isinf(abc)

  0 Comments

Sign in to comment.


Answer by KALYAN ACHARJYA on 24 Jun 2019 at 13:37

y=abc>=0 && isinf(abc)

  0 Comments

Sign in to comment.