8.8k views
2 votes
Suppose the MATLAB variable exampleArray is defined by: exampleArray = [4, 6, 10; 11, 7, 6; 0, -1, -4];

Click on the array that shows the results of the MATLAB command: x = min(exampleArray)

Options:
A) [4, 6, 10]
B) [11, 7, 6]
C) [0, -1, -4]
D) 11

1 Answer

1 vote

Final answer:

The min function in MATLAB finds the smallest values column-wise in a matrix. For exampleArray, the min function returns [0, -1, -4], which represents the smallest values from each of the three columns.

Step-by-step explanation:

When the min function is applied to a matrix in MATLAB, it returns a row vector containing the minimum value from each column. Hence, for the given matrix exampleArray = [4, 6, 10; 11, 7, 6; 0, -1, -4], the command x = min(exampleArray) will compare values column-wise and return the smallest value from each column.

Therefore, the resulting array x will be the minimum of the first column (4, 11, 0), which is 0, the minimum of the second column (6, 7, -1), which is -1, and the minimum of the third column (10, 6, -4), which is -4. So, x would be [0, -1, -4].

The correct answer to the question is option C, [0, -1, -4].

User Volker Rose
by
8.2k points