MATLAB Quiz
Fast practice, instant feedback. Timer auto-submits when time’s up.
Avg score: 5% Most missed: “Which code snippet sets a new random seed based on the current time and saves th…”

MATLAB MCQs For LinkedIn Skill Assessments.

MATLAB is a proprietary multi-paradigm programming language and numeric computing environment.

MATLAB Quiz
Time left 00:00
25 Questions

1. Which statement creates a logical array that is 1 if the element in 'passwords' contains a digit and 0 if it does not?
'passwords = {'abcd' '1234' 'qwerty' 'love1'};'
2. What does 'b' contain?

a =
19 20 12 0 6
6 9 56 0 3
46 8 9 8 19
9 8 8 19 46
1 9 46 6 19
3. Which function could you use for multiple linear regression?
4. What is the size of 'b'?

a = [1 2 3];
b = repmat(a,2,3);
5. What is the state of a at the end of this code?

a = [1 2; 3 4];
b = a(:,2);
c = b + 3;
a(1:2,1) = c;


a =
6 3
7 4
6. Which choice will NOT give you a 5 x 5 identity matrix?
7. Given the following x and y coordinates, which choice calculates a linear regression for the x and y coordinates, and which plots the points of the x,y data and the regression line on the same graph?

x = 9.0646 6.4362 7.8266 8.3945 5.6135 4.8186 2.8862 10.9311 1.1908 3.2586
y = 15.4357 11.0923 14.1417 14.9506 8.7687 8.0416 5.1662 20.5005 1.0978
8. You have plotted values of cosine from -10 to 10 and want to change the x-axis tick marks to every pi, from -3*pi to 3*pi. Which statement will do that?
9. What does the Profiler track?
10. Which choice has a different final result in 'f10' than the other three?
11. What is a reason to save a MAT-file using the '-v7.3' flag?
12. What built-in definition does i have?
13. You have a matrix 'data' in which each column is mono audio recording from a room in your house. You've noticed that each column has a very different mean and when you plot them all on the same graph, the spread across the y axis make it impossible to see anything. You want to subtract the mean from each column. Which code block will accomplish this?
14. Which code block most likely produced this graph?
15. Which choice is correct syntax for a 'switch' statement?
16. Which choice is the proper syntax to append a new elements 'a' to the end of 1x 2 dimensional cell array 'C'?
17. At what will MATLAB look first for a called function?
18. Where in the UI can you see what variables have been created, their values, and their class?
19. Which code block contains the correct syntax for a 'while' loop?
20. Which choice is the correct syntax for declaring a function that returns the input value as the output?
21. What is a difference between global variable and persistent variables?
22. Which statement turns 'menu' into the variable 'menu_string' below?

menu = {'hot dog' 'corn dog' 'regular burger' 'cheeseburger' 'veggie burger'}
menu_string =
'hot dog
corn dog
regular burger
cheeseburger
veggie burger'
23. What is the result of this code?

a = 1;
b = 2;
c = 3;
d = 4;
e = c / (~a - b == c - d);
24. Which command will create a 10-element vector v with values from 1 to 10?
25. What is the value of 'c'?

a = ones(1,3);
b = 1:3;
c = conv(a,b)