what will be a and b in the function call [a b] = max ([1 -5 6 -3])?

Answers (1)

The result:
a = 6
b = 3
The reason is that 6 is the maximum of the vector, and 3 is the index of 6 in the vector. See the documentation for max for details.

Categories

Asked:

on 17 May 2014

Answered:

on 17 May 2014

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!