Help with minimum of a matrix

3 ビュー (過去 30 日間)
aurc89
aurc89 2014 年 9 月 18 日
コメント済み: John D'Errico 2014 年 9 月 18 日
Hello! I have a function which generates a matrix M containing elements. Some of them are infinite (- Inf for example). I need to extract the minimum finite value of M, but if I write min(M) I obtain of course - Inf. What command can I use ? Thanks

採用された回答

Michael Haderlein
Michael Haderlein 2014 年 9 月 18 日
min(M(~isinf(M))
  2 件のコメント
aurc89
aurc89 2014 年 9 月 18 日
Thanks
John D'Errico
John D'Errico 2014 年 9 月 18 日
Yep.

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

その他の回答 (1 件)

Youssef  Khmou
Youssef Khmou 2014 年 9 月 18 日
As are you are concerned about the global mean, you truncate the Inf elements and compute the min:
M(isinf(M))=[];
min(M)
  1 件のコメント
aurc89
aurc89 2014 年 9 月 18 日
Thanks

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

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by