Matlab Built-in Functions Quiz
40 comprehensive questions on MATLAB's built-in functions covering mathematical operations, statistical computations, NaN/Inf handling, and data validation functions — with 16 code examples to master MATLAB's cpp quiz computational capabilities.
Question 1
What is the basic trigonometric function for sine in MATLAB?
Question 2
How do you compute the square root of a number in MATLAB?
result = sqrt(16);Question 3
What does the exp function do?
result = exp(1);Question 4
How do you calculate the natural logarithm in MATLAB?
result = log(2.718);Question 5
What is the purpose of the abs function?
result = abs(-5);Question 6
How do you compute the mean of an array?
data = [1, 2, 3, 4, 5];
avg = mean(data);Question 7
What does the std function compute?
data = [1, 2, 3, 4, 5];
s = std(data);Question 8
How do you find the minimum value in an array?
data = [5, 2, 8, 1, 9];
min_val = min(data);Question 9
What is the isnan function used for?
result = isnan([1, NaN, 3]);Question 10
How do you check if a value is infinite?
result = isinf([1, Inf, -Inf, 3]);Question 11
What does the isempty function check?
result = isempty([]);Question 12
How do you check if a variable is numeric?
result = isnumeric(42);Question 13
What is the round function used for?
result = round(3.7);Question 14
How do you compute the sum of array elements?
data = [1, 2, 3, 4, 5];
total = sum(data);Question 15
What does the length function return?
arr = [1, 2, 3, 4, 5];
len = length(arr);Question 16
How do you find the median of data?
data = [1, 3, 5, 7, 9];
med = median(data);Question 17
What is the difference between log and log10 functions?
Question 18
How do you handle NaN values in statistical calculations?
Question 19
What does the fix function do?
Question 20
How do you compute the variance of data?
Question 21
What is the purpose of the rem function?
Question 22
How do you find the maximum value and its index?
Question 23
What does the sign function return?
Question 24
How do you compute the product of array elements?
Question 25
What is the difference between floor and ceil functions?
Question 26
How do you handle division by zero in MATLAB?
Question 27
What does the mod function do?
Question 28
How do you compute cumulative sum?
Question 29
What is the purpose of the rand function?
Question 30
How do you find unique values in an array?
Question 31
What does the sort function do?
Question 32
How do you compute the correlation coefficient?
Question 33
What is the difference between var and std?
Question 34
How do you compute matrix determinant?
Question 35
What does the norm function compute?
Question 36
How do you compute matrix inverse?
Question 37
What is the purpose of the find function?
Question 38
How do you compute the size of an array?
Question 39
What does the diff function do?
Question 40
Considering MATLAB's built-in function ecosystem as a whole, what fundamental advantage does it provide compared to implementing mathematical operations from scratch?
