Question: Question 2 (10 marks) Given the following matrix X; X = 11 2 3 4 5 12 4 6 8 10 121 a) Write a
Question 2 (10 marks) Given the following matrix X; X = 11 2 3 4 5 12 4 6 8 10 121 a) Write a suitable MATLAB code to create a matrix Y only from the given matrix X above. Assume that X is already declared in the workspace. 11 2 3 4 5 6 Y = 2 4 6 8 10 12 12 4 6 8 10 12 (5 marks) b) Consider the following MATLAB code. Determine the final values of a, n and 2. a = X(:, [2 4 6]) - 4; n = logical(a): Z = X(n)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
