This set of MATLAB Multiple Choice Questions & Answers (MCQs) focuses on “Complex Arithmetic”.
1. Which command is used to find the argument of a complex number?
d) cannot be determined
Explanation: The argument of a complex number is only the angle which satisfies the cartesian equations used to represent the real and imaginary part of the complex number. Thus atan2() is the in-built function to find the angle or the argument, in MATLAB. abs() is used to find the modulus of the complex number. args() is not a valid function in MATLAB.
2. What is the class of the complex number?
Explanation: Since the complex number represented in MATLAB uses ‘i’ as a symbolic character, the class of any complex number is symbolic. It is not double and it is certainly not a character. An array is the general class of any variable or expression used in MATLAB.
3. What is the argument of -1-i in MATLAB?
Explanation: We observe that the complex number lies in the 3rd quadrant. Hence, we conclude that the argument of the complex number -1-i will be -3*pi/4 in MATLAB. -7*pi/4 is equivalent to -3*pi/4. Pi/4 is 5*pi/4 again.
4. What will be the output of the following code?
Explanation: MATLAB returns all values of angles in radians. Hence, we will not see the output as -pi/4. The argument is -pi/4 but MATLAB will return -.7854.
5. The modulus of z, z conjugate and -z are not equal in MATLAB.
Explanation: The modulus of z, z conjugate and -z are equal. The magnitude of the modulus is always a positive number. It is independent of the positive or negative nature of the real and imaginary parts of the complex number.
6. What will be the output of the following code?
a) z conjugate
Explanation: Following the precedence of operators,
2+3i/(i99)=2-3=-1. If we had given 2+3i within brackets, the value would have been -3+(2*i). The answer won’t be -z or z conjugate.
7. What is the output of the following code?
a) a sinusoidal signal
b) an exponential signal
c) a discrete sinusoidal
d) no plot
Explanation: No plot will be generated. This is because colon operands cannot have complex arguments. It has to be real arguments.
8. What is the command used to check the real part of a complex number in MATLAB?
d) cannot be checked
Explanation: The command to check the real part of any complex number is real(). It is an inbuilt function in MATLAB.
9. Which of the following command can be is used for complex arithmetic?
Explanation: The abs() command is used to get the modulus of any complex number. The rest of the options are wrong because they should be ‘atan2()’, ‘real()’ and ‘imag()’.
10. What will be the output of the following code?
Explanation: The abs command is used to find the magnitude of the complex argument given to it. Since magnitude is a positive value, the output will be a positive value and not -1.
Sanfoundry Global Education & Learning Series – MATLAB.
To practice all areas of MATLAB, here is complete set of 1000+ Multiple Choice Questions and Answers.
Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!