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 件)

カテゴリ

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by