Matlab Questions Part 3-Vector and Matrlx Subsets, Built-In Math and Statistical
ID: 3873554 • Letter: M
Question
Matlab Questions
Part 3-Vector and Matrlx Subsets, Built-In Math and Statistical Functions (30 points) Directions: For each expression, fill in the blank with the resulting vector or matrik subset. ·Given d [4 5 6 7 8 9 31 What are the results of the following MATLAB expressions (2pts) (3pts) d(2:4) d(S:end) he n (3pts) ,27. Given: x = [4 3 2 1; 8 7 6 5:4578] What are the results of the following MATLAB expressions: (2pts) x(2,3) (2pts) x(12:31,12:31) (3pts) 3pts) Given: v [1 35 3] What are the results of the following MATLAB expressions sum(v) mean(v) max(v) mln(v) prod(v) (2pts) (3pts) (2pts) - (2pts) (3pts)Explanation / Answer
26.) since array in matlab are 1-indexing. therefore
d(3) = [6]
d(2:4) = [5 6 7]
d(5:end) = [8 9 3]
27.)
x(1,3) = [2]
x(2,3) = [6]
x([2:3],[2:3]) = [7 6; 5 7]
x([:,3]) = [2; 6; 7]
28.)
sum(v) = 12
mean(v) = 3
max(v) = 5
min(v) = 1
prod(v) = 45
Hope it helps, do give your valuable response.