Matlab Test 1 || with Complete Solutions.
What are the values in F after the following command is executed: V = 1:4 correct answers 1 2 3 4 Which of the following is the correct Matlab statement to create: c = [22 17 4] correct answers c = [22; 17; 4] What is the value of x after the following code segment is executed? n = [6, 2, 5] x = max(n) correct answers 6 What is the value of x after the following code segment is executed? n = [6, 2, 5] [x,y]= max(n) correct answers x = 6 y = 1 matrixA = [1 5; 4 8; 3 11]; sortedMatrix = sortrows (matrixA, -2); What are the values in the sorted Matrix correct answers 3 11 4 8 15 What is the value of x after the following code segment is executed? n = [6, 2, 5; 4, 3, 1] x = max(n(:,2)) ; correct answers 3 What is the value of x after the following code segment is executed? n = [6, 2, 5; 4, 3, 1] [x,y] = max(n(:,2)) ; correct answers x = 3 y = 2 For each group of statements, give the final value of x if the initial value of x is 2. For the if-else statements, the final value of x is: if x0 x = x+1; elseif x= 2 x = x+2; end correct answers 3 For each group of statements, give the final value of x if the initial value of x is 2. For the if-else statements, the final value of x is: if x0 x = x+1; end if x= 2
Document information
- Uploaded on
- May 21, 2024
- Number of pages
- 7
- Written in
- 2023/2024
- Type
- Exam (elaborations)
- Contains
- Questions & answers