What is the output of the following code? [code]P=eval(‘ ’)[/code]

What is the output of the following code?
Code:
P=eval(‘ ’)
A. P= ‘ ’
B. P will be an empty character array
C. Error
D. No such function
 
Answer: c
Explanation: We have assigned the output of the eval command to an expression. Hence, we will have to give an expression within ‘’ which results into any value. Here, we haven’t provided any expression so the statement in not complete. Hence, MATLAB returns an error.
 

Tìm kiếm

Back
Top