matrix

Hi there, I have a square matrix and I want to find location of the maximum and minumum in each row.
EDITED!

 采纳的回答

Andrei Bobrov
Andrei Bobrov 2012-5-23

1 个投票

EDIT
A = rand(5)
[id,id] = sort(A,2)
minrowloc = id(:,1)
maxrowloc = id(:,end)

更多回答(0 个)

类别

帮助中心File Exchange 中查找有关 Annotations 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by