These MATLAB multiple-choice questions and their answers will help you strengthen your grip on the subject of MATLAB. You can prepare for an upcoming exam or job interview with these 30 MATLAB MCQs.
So scroll down and start answering.
A. Normal
B. Poisson
C. Binomial
D. Uniform
A. Median
B. Mode
C. Mean
D. Margin
A. Execution time
B. Command history
C. Errors
D. The value of variables
A. Argument placeholder
B. Block quotes
C. Code sections
D. Conversion specifier
A. Structure field access
B. A decimal point
C. Cell array access
D. Element-wise operations
A. Polyval
B. Regress
C. Solve
D. Polyfit
A. [0 1 1 1 2]
B. [1 3 5 5 6]
C. [0 1 1 1 1]
D. [0 0 5 5 5]
A. Your plot doesn't plot in a figure window because figure was not called immediately in advance.
B. Your plot syntax is incorrect.
C. Your plot is in a figure window that was already open, hidden behind other windows on your screen.
D. Your plot was saved to an image file but not displayed.
A. S['name']
B. S.name
C. S('name')
D. S{'name'}
A. Basic imaginary unit
B. Index function
C. Infinity
D. Index variable
A. Xticks(-3pi:3.14:3pi)
B. Xticks(-3pi:pi:3pi)
C. Xticks(linespace(-3pi(), 3pi(), pi()))
D. Xticks(linespace(-3pi, 3pi, pi)
A. Datasample
B. Randi
C. Resample
D. Randperm
A. When you pass a handle object to a function, a new object is made that is independent of the original.
B. All copies of handle objects refer to the same underlying object.
C. Handle object cannot reference one another.
D. Handle object do not have a default eq function.
A. c = {"hello world" {"hello"} "goodbye" [1 2 ]};
B. c = {"hello world" {"hello"} "goodbye" {[1 2 3]}};
C. c = {"hello world" {"hello"} "goodbye" [1 2 3]};
D. c = {"hello world" {"hello" "hello"} "goodbye" {[1 2 3]}};
A. A = a + reshape(b, 4, 1);
B. A = a + b';
C. A = a + repmat(b, 4, 1);
D. A = a + [b b b b];
A. Poly([1 2 -4])
B. Solve(x^2 + 2x - 4 == 0)
C. Polyfit(x^2 + 2x - 4 == 0)
D. Roots([1 2 -4])
A. C = {C a};
B. C = cellcat(C a)
C. C = cat(2, {a}, C)
D. C{end+1}=a
A. Sim_height = std(height) + mean(height) * randn(100, 1);
B. Sim_height = mean(height) + std(height) * randn(100, 1);
C. Sim_height = randn(std(height), mean(height), [100, 1]);
D. Sim_height = randn(mean(height), std(height), [100, 1]);
A. Menu{strfind(menu, 'burger')}
B. Menu(strfind(menu, 'burger'))
C. Menu{contains(menu, 'burger')}
D. Menu(contains(menu, 'burger'))
A. You can use the sparse function to remove empty cells from cell array variables.
B. Sparse matrices always use less memory than their associated full matrices.
C. Mixtures of sparse and full matrices can be combined in all of MATLAB's built-in arithmetic operations.
D. The sparse function requires its input to be a full matrix with at least 50% zero elements.
A. B = a(a ~= 11)
B. B = a(a == 1)
C. B = a(a>6 && a<9)
D. B = a(a | 1)
A. Contains(password, '\d')
B. ~isempty(regexp(passwords, '\d'))
C. Cellfun(@(x) ~isempty(regexp(x, '\d')), passwords)
D. Regexp(passwords, '\d')
A. Title
B. Text
C. Label
D. Legend
A. Figure files
B. Script files
C. Function files
D. Stored variable files
A. a == b
B. Ischar(b)
C. Length(a) == length(b)
D. Class(a) == class(b)
A. Editor
B. Command window
C. Details
D. Workspace
A. You are attempting to multiply a non-square matrix by itself, causing a dimension mismatch.
B. MATLAB does not allow you to square all the elements in the matrix in a single operation.
C. You must use the ** operator instead of the ^ operator.
D. You cannot square matrices that have a 0 as the first element.
A. V = {1:10}
B. V = [1-10]
C. V = 1:10
D. V = (10)
A. 7
B. 8
C. 17
D. 9
A. Global variables have a higher performance overhead than persistent variables.
B. Global variables remain in memory after clear all; persistent variables do not.
C. Global variables can be used to cache data in memory; persistent variables cannot.
D. Global variables are accessible outside the function scope; persistent variables are not.
A. Seed is undefined until it is initialized by the user.
B. Seed is set to a value based on the current time when user first calls rand()
C. Seed is set to a value based on the current time on startup.
D. Seed is set to a static default value on startup.
A. h_f = figure; set(h_f,'Color', [0 0 0]);
B. h_a = gca; set(h_a,'Color', [0 0 0]);
C. h_a = axes; set(h_a,'Color', [0 0 0]);
D. h_f = gcf; set(h_a,'Color', [0 0 0]);
A. 2*[1:5]+1
B. 1:2:9
C. Isodd(1:9)
D. 1:odd:9
A. 1x3
B. 3x2
C. 2x3
D. 2x9
A. Reverse(a)
B. A(end:- 1:1)
C. Rev(a)
D. A(::-1)
A. C = [7,8,9]
B. C = [7: 8: 9]
C. C = [7; 8; 9]
D. C = [7 8 9]
A. Who
B. Vars
C. Whos
D. Who all
A. Which
B. Who
C. Lookfor
D. What
A. To ensure backward compatibility
B. To avoid HDF5 overhead in MAT-file
C. To include a variable greater that 2GB
D. To use compression by default