Minimum Value Search

1 回表示 (過去 30 日間)
James
James 2011 年 7 月 18 日
Hi
I have a matrix size 200*200, which all store a set of numbers
I want to find the minimum value on each row of my matrix.
I want to end up with new 200*1 array which stores the column number where the minimum value for that row has been found.
I hope somebody can help!

回答 (1 件)

Jan
Jan 2011 年 7 月 18 日
x = rand(200, 200);
[value, index] = min(x, [], 2)
"help min" contains a corresponding example. Reading the help and doc text is always a good idea.

カテゴリ

Help Center および File ExchangeLogical についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by