166k views
4 votes
Given the MATLAB variable: C = [ 6, 8, 10; 12, 4, 11 ]. Which answer below provides the value of E if: E = max(C)?

Options:
A) [10, 12]
B) [12, 8, 11]
C) [6, 12, 11]
D) [12, 8, 11]

1 Answer

5 votes

Final answer:

Applying the 'max' function to the 2x3 matrix 'C' without specifying a dimension results in a row vector containing the maximum values of each column, which is E = [12, 8, 11].

Step-by-step explanation:

The MATLAB variable C is a 2x3 matrix:

C = [6, 8, 10;
12, 4, 11]

When we apply the max function to this matrix without specifying a dimension, MATLAB will default to operating along the first dimension (columns). Therefore, the max function returns the maximum value from each column. The correct answer will then be a row vector containing the maximum values from each column:

E = max(C);

The first column's max is 12, the second's max is 8, and the third's max is 11, resulting in:

E = [12, 8, 11]

User Johannestaas
by
8.3k points