Customizing and Manipulating Graphics

MATLAB

This set of MATLAB Multiple Choice Questions & Answers (MCQs) focuses on “Customizing and Manipulating Graphics”.

1. How can we introduce texts in a graph?
a) Use the text command
b) Use the plot command
c) Use the title command
d) Additional texts not possible

2. What is the output of the following code?

t=linspace(0, 2*pi, .1*pi); plot(t,sin(t)); text[2,-2, ‘Ho !’];

a) a graph of sin(t)
b) a graph of inverted sin(t)
c) a graph with Ho ! written
d) error

3. How many objects are created for 24 texts written in the graph?
a) 22
b) 24
c) 21
d) 2

4. What is the output of the following code?

t=linspace(0:.1*pi:2*pi);plot(t,sin(t));text(0.5,1,’Ho !’,’colour’,’red’)

a) Error
b) A graph with Ho! written
c) A An inverted sinusoid
d) An inverted sinusoid with Ho written

5.What is the output of the following code?

t=linspace(0:.19*pi:27*pi);plot(t,sin(t));text(0.5,1,’color’,’red’)

a) Error on plot command
b) Error in linspace command
c) Error in text command
d) A graph of a sinusoid with Ho ! written on it.

6. What is the output of the following code?

t=linspace(0,.00002*pi,2*pi);plot(t,cos(t));text(0.5,1,'color','blue')

a) Syntactical Error due to text command
b) Input error due to text command
c) Error in linspace command
d) A graph of sinusoid with Ho ! written on it

7. What is the output of the following command?

t=linspace[0,20*pi,2*pi];plot(t,tan(t));text(0.5,1,'Ho!','color','blue')

a) Syntactical error in the text command
b) Error in input of plot command
c) Error in linspace command
d) The graph of tan(t) w.r.t. t with Ho ! writted

8. What is the output of the following code?

t=linspace(0,.5,2*pi);plot(t,sin(t));text(0.5,1,'\mu Ho!','color','blue')

a) A sinusoid with µHo! written
b) A sinusoid with Ho! written
c) Error in the text command
d) A sinusoid with \mu Ho! written

9. What is the output of the following code?

t=[-10:1:10];plot(t,t), text(0,0,’Origin’,color,’blue’)

a) A ramp function with Origin written in Blue
b) A ramp function with Origin written in Blue and center left alignment
c) Error
d) A ramp function with Origin

10. The text given to the graphs can be made bold.
a) True
b) False

11. The font style of the input text can be changed by the ____
a) fontname{}
b) fontstyle{}
c) fontname()
d) fontname[]

12. What is the output of the following code?

t=[-10:1:10];plot(t,3*t), text(0,0,’Origin’,color,’blue’,’verticalalignment’,’left’)

a) A ramp function with Origin written in Blue and left alignment
b) A ramp function with Origin written in Blue
c) A ramp function with Origin written in Blue and center left alignment
d) Error

13. The default colour of graph generated by the plot command is blue.
a) True
b) False

14. What is the output of the following command?

T=[-1:1:90];plot(T,T,’G’)

a) A green ramp function
b) Error
c) A grey ramp function
d) A ramp function

15. What is the output of the above code?

T=[-1:1:90];plot(T,T,’-o’, 'MarkerIndices',1:6:length(T))

a) A green ramp function
b) A ramp function with y value marked at lengths of 5
c) A ramp function with y value marked
d) A ramp function with y value marked at lengths of 6

16. What is the output of the following code?

t=[0:.1*pi:pi];plot(t,sin(t),’MarkerIndices’,1:rms(sin(t)):length(sin(t))

a) Error
b) A sinusoid
c) A half wave sinusoid marked at interval of r.m.s. values
d) A green colored sinusoid

17. The fill command cannot take more than ______ inputs.
a) 1
b) 3
c) 2
d) Many

18. What is the output of the following code?

t=0:.000001:pi;x=sin(t);y=cos(t);fill(x,y)

a) An ellipse
b) Error
c) A semi-circle
d) A sinusoid

19. What is the output of the following code?

w=[0:.1*pi:2*pi];plot(w,sin(w),’ ’)

a) A sinusoid
b) A blank graph
c) Error in plot command
d) A sinusoid with a phase difference

20. What does the set command do?
a) The operation of the fill command
b) The operation of changing intervals of axes
c) The operation of the plot command
d) The operation of the figure command

21. What is the nature of the 2nd vector input in the following command?

set( X,vector_1, vector _2 );

a) a m*n matrix where m=length( vector_1 )
b) a m*n matrix where n=length( vector_1 )
c) a m*n matrix where m>length( vector_1 )
d) a m*n matrix where n>length( vector_1 )

22. A semi-log graph cannot be plotted in MATLAB.
a) True
b) False

23. What is the output of the following code?

t=[-2:1:2];plot(t,t);ax=gca;ax.Xscale=’Logarithmic’;

a) Error
b) Syntactical error
c) A semi-log graph of a ramp function
d) A ramp function

24. What is the output of the following code?

t=[-2:1:2];plot(t,exp(t));ax=gca;ax.Yscale=’Log’;

a) Error
b) An exponential graph
c) A logarithmic function
d) A ramp function

25. Using the set command for axes can be replaced by setting the ___ to a variable.
a) gca
b) gcf
c) gco
d) not possible

26. What is the output of the following code?

plot([-3:1:3],[-3:1:3]);cla;

a) Error
b) A ramp function
c) A graph of a ramp function with no axes
d) A window having two axes

27. How many objects are created for 24 texts written in the graph?
a) 22
b) 24
c) 21
d) 2

Leave a Reply

Your email address will not be published. Required fields are marked *