[~,i]=max(y); what does it mean in matlab
25 ビュー (過去 30 日間)
古いコメントを表示
can i know the meaning of this command "[~,i]=max(y);" in matlab??
0 件のコメント
回答 (1 件)
Mark Sherstan
2019 年 2 月 15 日
編集済み: Mark Sherstan
2019 年 2 月 15 日
The ~ represents an output that is discarded. It is essentially equivalent to:
[dummy,idx]=min(dists);
clear dummy
For this example, the code wants to work with the index of the minimum value, not the value itself, so the minimum value that is returned is discarded and only the index is retained.
0 件のコメント
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!