What is the output of the following code? [code]sym x;limit(log(x)^(log(x)),x,1)[/code]

Hưng Thịnh

New member
What is the output of the following code?
Code:
sym x;limit(log(x)^(log(x)),x,1)
A. Error
B. 1
C. 0
D. Cannot be defined
 
Answer: a
Explanation: When we declare a symbolic character, we use syms. If we use sym, the symbolic character is assigned to the variable ans. So, we haven’t defined x as symbolic; we have defined ans as a symbolic character which points to the character x. So, MATLAB will give an error because it cannot find x as a symbolic character. If we change the code to sym x;limit(log(ans)^(log(ans)),x,1); the answer would be 1.
 

Tìm kiếm

Back
Top