# Vectors and Matrices – 2 MCQ’s

This set of MATLAB Multiple Choice Questions & Answers (MCQs) focuses on “Vectors and Matrices – 2″.

1. What is the output of the following code?

A=[1 2 a..; ];

a) Error due to a

b) Error due to A

c) Error due to [];

d) Error due to ;

2. What is the output of the following code?

A=[1 2 ‘a’;… ];

a) Error due to ‘a’

b) Error due to ‘…’

c) Error due to []

d) ‘a’

3. What is the output of the following code?

A=[1 2 3.. ];

a) The output is suppressed

b) A row vector

c) A row vector concatenated with a null matrix

d) Error

4. What is the output of the following code?

A=[1 2 ‘a’;… ‘f’ ‘q’ ‘w’;… ]];

a) Syntax Error

b) A 2*3 character matrix

c) The concatenation of 2 vectors, vertically, with size 3

d) Cannot be determined

5. What is the output of the following code?

A=[1 2 ‘a’;… ‘f’ ‘q’ ‘w’];

a) A 2*3 character array

b) A 3*2 character matrix

c) A 3*2 character vector

d) A 2*3 character vector

6. What is the output of the following code?

A=[1 2 ‘a’….; ‘a’ ‘b’ ‘c’;… ];

a) A 1*6 matrix

b) A 6*1 matrix

c) Error in the code

d) Error in ellipsis

7. What is the output of the following code?

A=[1 2 ‘a’…; ‘a’ ‘b’ ‘c’;… ];

a) Error in syntax

b) A 3*2 matrix of characters

c) Error due to 1 and 2

d) Error due to a

8. All matrices are vectors but all vectors are not matrices in MATLAB.

a) True

b) False

9. What is the output of the following code?

clear ALL

a) Clears the workspace

b) Clears the matrices

c) Clears the vectors

d) Clears ALL

10. What is the output of the following code?

isvector([]);

a) 1

b) 0

c) Syntactical error

d) Logical error

11. What is the output of the following code?

ismatrix([]);

a) logical 1

b) logical 0

c) logical -1

d) Error

12. If the dimensions of vectors don’t match, the plot command will always give an error.

a) True

b) False

## Average Rating