# Two-Dimensional Plots

This set of MATLAB Multiple Choice Questions & Answers (MCQs) focuses on “Two-Dimensional Plots”.

1. How can we smoothen the following graph of sin (t) and cos (t) into a circle?

a) reduce the gap between linearly spaced elements of the dependent variable t
b) reduce the gap between elements of the dependent variable t
c) increase the gap between linearly spaced elements of the dependent variable t
d) increase the gap between elements of the dependent variable t

2. Which command gives a title to the graph plotted by MATLAB?
a) plot() generates the title itself
b) title()
c) hlabel()

3. Which command enables a title for the x-axis?
a) xlabel()
b) horilabel()
c) xlabel[]
d) no command

4. Which command enables a title for the y-axis?
a) vertlabel()
b) ylabel()
c) ylabel[]
d) no command

5. How can several graphs for the same function be plotted on the same window?
a) Contour plots
b) Bode plots
c) 3-D plots
d) n-D plots

6. What is the output of the following command?

`meshgrid[x,y]`

a) two x*y matrices
b) one x*y matrix
c) one y*x matrix
d) error

7. What is the output of the following code?

```t=0:0.001*pi:pi/2;
plot(t,sin(t),*);```

a) An inverted sine curve
b) A sine curve
c) A point
d) Error

8. What is the slope of the sawtooth waveform generated by the sawtooth command?
a) 1/pi
b) pi
c) 1/(2*pi)
d) 2*pi

9. What is the period of the sawtooth() waveform which is generated by the sawtooth() command?
a) 2*pi
b) pi*2
c) pi
d) 3*pi/2

10. The command used to generate an array of arrows is ________
a) quiver[]
b) arrows()
c) quiver()
d) arrows[]

11. What is the output of the following code?

```t=0:.001*pi:2*pi;
plot(cos(t),sin(t))```

a) A circle
b) A straight line
c) A unit circle
d) A sinusoid

12. The period of sinusoidal curves can be changed in MATLAB.
a) True
b) False

13. The command to draw the nature of a function over a default fundamental period is _________
a) ezplot()
b) plot()
c) stem()
d) plot3()

14. In the following code, what is the fundamental frequency of the sawtooth command?

`f=1/50; sawtooth(2*pi*1/f*t)`

a) 50
b) .02
c) 100
d) Error

15. The limits of the axes drawn are only specified in the command used to plot the graph itself.
a) True
b) False

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

17. 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

18. 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

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

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

21. 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

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

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

24. 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

25. 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

26. What is the output of the following code?

`title(‘x^2+y^2=r^2’)`

a) x2+y2 = r2
b) x^2+y^2 = r^2
c) Error
d) No such command

27. What is the output of the following code?

`t=linspace(0,3*pi);p=sin(t);y=cos(t);plot(t,p,t,q);`

a) Error
b) Multiple plots
c) A unit circle
d) A sinusoidal

28. What is the default range used by the fplot command?
a) [-5,5]
b) (-5,5)
c) No default range
d) No such command