What is the output of the following code? [code]polyint[{1 2 3}][/code]

What is the output of the following code?
Code:
polyint[{1 2 3}]
A. Syntactical error due to []
B. Syntactical Error due to {}
C. Logical Error
D. [1/2,1,3]
 
Answer: b
Explanation: The answer would’ve been d. But the input to the polyint command is a cellular array and this results in a syntactical error. But firstly, the input to the polyint command should be within parentheses. But here, the input is within [] which is the first error MATLAB finds.
 

Tìm kiếm

Back
Top