The correct way of using the quad command while integrating an

the-correct-way-of-using-the-quad-command-while-integrating-an

The correct way of using the quad command while integrating an inline non-linear function is ___________

A. quad(‘[]’)

B. quad([‘’])

C. quad([])

D. quad(‘’)

I had been asked this question in an online interview.

Question is from Integration topic in portion Beyond the Basics of MATLAB

Right answer is A. quad(‘[]’)

Explanation: The inline function, being a non-linear function and saved as an inline class, will be given as a string argument to the quad() command. Due to its non-linear nature, it has to be placed like a matrix. quad(‘’) will only take the function but the function is non-linear so it will show an error. quad([‘’]) is wrong because the ‘’ should comprise the entire function, hence it should be outside []. quad([]) is syntactically wrong.