1.

Which function is preferable to find the magnitude of a complex number?(a) abs()(b) sqrt()(c) cart2pol()(d) MATLAB does not support complex argumentsThe question was posed to me in an interview for internship.This interesting question is from Variables and Assignments topic in portion MATLAB Basics of MATLAB

Answer»

Right CHOICE is (a) ABS()

EXPLANATION: In the function sqrt(), we have to write the polynomial which shows the sum of squares of the real and imaginary part within the parentheses. But in abs(), we only have to enter the variable which we’ve used to define the complex NUMBER. So abs() is more preferred.



Discussion

No Comment Found

Related InterviewSolutions