Comparison of specific values from the same matrix

1 回表示 (過去 30 日間)
stelios loizidis
stelios loizidis 2020 年 10 月 3 日
コメント済み: stelios loizidis 2020 年 10 月 3 日
Hello.
I have the following problem: I have a table Z (1X100). The first value is always zero. I want to find among the other values which is the smallest and from which position of the matrix it comes. I wrote the code below but it does not work.
for w=1:100
if Z>0
[min_price,Index]=min(Z)
end
end
Your help is important.

採用された回答

KSSV
KSSV 2020 年 10 月 3 日
[val,idx] = min(Z(2:end))
  1 件のコメント
stelios loizidis
stelios loizidis 2020 年 10 月 3 日
It works. Thanks for the help!!!

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

その他の回答 (0 件)

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by