Print column value for lowest element in each row of an 2D array

1 回表示 (過去 30 日間)
Koule Pantazopoulos
Koule Pantazopoulos 2018 年 8 月 30 日
I have a 2D array 20 X 10 double. Each row has a lowest figure. I am trying to obtain the column index of the minimum element in each row. I do not need the row index, just the column index. An elegant solution was provided ([~,idc] = min(A,[],2). It is able to be displayed. However, I am now having difficulty using fprintf to print the solution.Assistance appreciated
  1 件のコメント
Koule Pantazopoulos
Koule Pantazopoulos 2018 年 8 月 31 日
Your solution helps me format the answer. Thanks you

サインインしてコメントする。

採用された回答

Greg
Greg 2018 年 8 月 31 日
Why do you want to fprintf the result? Anyway, try:
fprintf('%d\n',idc);

その他の回答 (0 件)

カテゴリ

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

製品


リリース

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by