想象一下,我在 Mathematica 中有一个二维数字列表:
myList = Table[{i,i*j},{i,1,10},{j,1,10}];
我想以有效的方式检索第 5 个最高值。使用 RankedMax 会出错。例如,
Max[myList]
给出 100 但是:
RankedMax[myList,1]
给出:
RankedMax::vec : "Input {{{1, 1}, {1, 2}, {1, 3}, {1, 4}, {1, 5}, {1, 6}, \
{1, 7}, {1, 8}, {1, 9}, {1, 10}}, {{2, 2}, {2, 4}, {2, 6}, {2, 8}, {2, 10}, \
{2, 12}, {2, 14}, {2, 16}, {2, 18}, {2, 20}}, 6, {{9, 9}, {9, 18}, {9, 27}, \
{9, 36}, {9, 45}, {9, 54}, {9, 63}, {9, 72}, {9, 81}, {9, 90}}, {{10, 10}, \
{10, 20}, {10, 30}, {10, 40}, {10, 50}, {10, 60}, {10, 70}, {10, 80}, {10, \
90}, {10, 100}}} is not a vector
如何在我的数据上使用 RankedMax,或者有其他方法吗?