find function
古いコメントを表示
Hello,
can anyone enlighten me about the use of find() function? Is it really so bad in performance to use? Any alternative?
Thanks, Chiara
採用された回答
その他の回答 (3 件)
Walter Roberson
2011 年 3 月 27 日
1 投票
logical indexing is often an alternative to find.
Performance -- it depends what you are trying to do. For some problems there are more efficient solutions. For example if relatively few of the elements are non-zero, then using sparse matrices might be productive. (Note: if you do use sparse matrices, then find() gets used even more often, but is quite efficient.)
jasprit kour
2011 年 3 月 27 日
0 投票
find function only gives you the index of the value u want to find. there is also option you can also get the row and column index and and you only get the non-zero values.
Mohammad amiri
2013 年 11 月 24 日
0 投票
for 2D matrix you can write: a=rand(10,10); [r,c]=find (a>0.5); return the row and column of matrix witch is greater than 0.5
カテゴリ
ヘルプ センター および File Exchange で Matrix Indexing についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!