207k views
0 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 = max(exampleArray, [ ], 2)

Options:
A) [11]
B) [10; 11; 0]
C) [10, 11, -1]
D) [10, 11, 0]

1 Answer

5 votes

Final answer:

Using the MATLAB command 'max' with the 'exampleArray', the maximum elements across each row are [10; 11; 0], corresponding to option D.

Step-by-step explanation:

The MATLAB command x = max(exampleArray, [], 2) will return the maximum elements of exampleArray along the second dimension, which is across each row. For the array exampleArray defined as [4, 6, 10; 11, 7, 6; 0, -1, -4], the maximum values across each row are 10, 11, and 0, respectively. So, the correct matrix that the command will return is [10; 11; 0], which corresponds to option D).

User Henrik R
by
8.2k points