1.

The output of int(x^2,1,3) and quad(‘x. ^2,1,3) is ________(a) Same(b) Different(c) Maybe different(d) ErrorThe question was asked by my school principal while I was bunking the class.I'm obligated to ask this question of Integration topic in section Beyond the Basics of MATLAB

Answer»

Right option is (b) Different

Explanation: The output for int(x^2,1,3) will be 26/3. The output for quad(‘x. ^2’,1,3) is 8.6667. Hence we find that each output will be different. The int command will RETURN a fractional form while the quad command will return a decimal form up to 4 PLACES of decimal, ROUNDED up to the 4^th decimal place.

Output:

For int(x^2,1,3): 26/3

For quad(‘x. ^2’,1,3) : 8.6667



Discussion

No Comment Found

Related InterviewSolutions