%% Complex Vector
% Compute the 2 largest elements of a complex vector according to their magnitude, and return the indices where they are located in the input vector.

A = [2-2i 5+i -7-3i -1+i]
[B,I] = maxk(A,2,'ComparisonMethod','abs')

% Copyright 2012 The MathWorks, Inc.