What will be the output of the following code? [code]sin(symsum(k^2,1,Inf));[/code]

What will be the output of the following code?
Code:
sin(symsum(k^2,1,Inf));
A. Nan
B. Inf
C. Error
D. Output is suppressed
 
Answer: d
Explanation: There is no error. MATLAB will first compute the expression within the sin() which will yield Inf. Thereafter, sin(Inf) is computed which is shown as Nan.
 

Tìm kiếm

Back
Top