MATLAB Questions and Answers Part-21

1. Which command is suitable to change the axes of the graph plotted?
a) axes
b) axis
c) yxaxes
d) no command

Answer: b
Explanation: The axis command can be used to change the interchange the axes of a 2-D plot. This is easier than re=-writing the plot command already used or any other command to generate a 2-d plot. The rest of the options are incorrect.

2. What is the output of the following code?
ezplot(x^2)
a) No such command
b) A parabola
c) A part of a parabola
d) Error

Answer: d
Explanation: The input to the ezplot command should be given within a set of single inverted commas. Hence, the above code would give and error since the input function is not given within a ser of single inverted commas.

3. Which command can be used to generate multiple graphs in the same window?
a) hold on
b) wait
c) not possible without contour command
d) not possible

Answer: a
Explanation: The command used to hold the control to an already generated graph so that further plots can be made on the same window is hold on. The contour command is used to generate graph of the same function on different levels while the hold on command is used to generate graphs of multiple functions in the same window.

4. Inline functions can be plotted by the _________ command.
a) ezplot()
b) plot3()
c) plot()
d) cannot be done

Answer: a
Explanation: The ezplot command takes in functions represented symbolically. The input is given as a string. So inline functions can be given as an input to the ezplot command to get a general graph of the input function.

5. Which toolbox provides the plot command?
a) Symbolic Maths Toolbox
b) Signal Processing Toolbox
c) Engineering Toolbox
d) Functions

Answer: b
Explanation: The commands in MATLAB are stored in files called toolboxes. The plot command is stored in the Signal Processing command while the ezplot command is stored in the Symbolic Maths Toolbox.

6. A power pattern for an antenna is a __________
a) 4-D plot of space and power
b) 3-D plot of space and power
c) 2-D plot of space and power
d) Nothing called power pattern

Answer: c
Explanation: The power pattern of the antenna is a 2-d polar plot of the power radiated by the antenna w.r.t theta in cylindrical co-ordinates. Hence, 2-d plot of space and power is only correct

7. The general graph of f(a,b)=0 is plotted by ______
a) ezplot()
b) plot()
c) stem()
d) not possible

Answer: a
Explanation: A general graph of the function can be viewed by using the ezplot. If we want to define the values of a/b, we will use the plot() or stem() command. Hence, the answer is ezplot().

8. What is the period of square wave generated by the square() command?
a) User-defined
b) pi
c) 2*pi
d) pi/2

Answer: c
Explanation: The square waves generated by the square(0 command will always have a period of 2*pi. We can change the duty cycle of the wave but the fundamental period is 2*pi.

9. What is the output of the following code?
plot(linspace[0,3*pi],square[linspace[0,3*pi]]);
a) A square wave from 0 to 3*pi
b) A square wave with 50% duty cycle from 0 to 3*pi
c) A square wave with 50% duty cycle
d) Error

Answer: d
Explanation: The input to the square command should be within parentheses. Here, we have not given the input vector with () and so MATLAB will show an error.

10. In a 2-d Plot, which command will make the axes of the graph same?
a) axis square
b) axis equals
c) axes square
d) axes equal

Answer: a
Explanation: There is no such command called axes. The command axis is used to change the axes of the graph that has been plotted in MATLAB. axis equal would’ve made the axes of equal length but axis equals has equals. axis square is the only correct option