What is the output of the following code? [code]Sin(Inf)==NaN[/code]

Answer: c
Explanation: If we type sin(Inf) in MATLAB, we will get NaN as an input because MATLAB cannot find the value of sin(Inf). But, MATLAB knows that sin(Inf) possesses a value, it cannot comprehend it but still it has a value. So, even though it will show NaN when we write sin(Inf), it will not give a logical 1 for the following code since sin(Inf) is still a number between 1 and -1.
 

Tìm kiếm

Back
Top