1.

The output for diff(p^2,q) is _______(a) 0(b) 2*p(c) 2 dp/dq(d) ErrorI had been asked this question during a job interview.My question comes from Differentiation topic in chapter Beyond the Basics of MATLAB

Answer»

Correct option is (a) 0

The explanation: We are differentiating the function ‘p^2’ with respect to q. Hence the VALUE will be 0. The 2^nd argument in the DIFF() command is the VARIABLE, with respect to which- we differentiate our function.

Output: 2*



Discussion

No Comment Found

Related InterviewSolutions