问题描述:

I understand that [M,I] = max(A) will get for me the value of the largest element in the array and also its index.

Is there a convenient way to obtain the index without also (unnecessarily, from my perspective) also obtaining the value?

Ideally I'd like to be able to do this so that I can just write index = function(A).

网友答案:

You can always put a ~ for any return you don't want, so, in your case, you'd have [~,index] = max(A).

相关阅读:
Top