複数の比較対象に関してどのインデックスが一致しているかを知る方法
Afficher commentaires plus anciens
たとえば,配列
11:20
に対して,
[11 12 14 14]
のように比較対象を用意します.
11は11:20の1番目の値に対応しています.同様に12は2番目,14は4番目の値です.
したがって,11:20と[11 12 14 14]を比較したとき,一致するインデックスの番号は
[1 2 4 4]
となります.
この結果を得るために,
rem((find((11:20==[11;12;14;14]).')),10)
とすることで所望の結果を得ることができましたが,もっと簡単な方法はないでしょうか?
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Matrix Indexing dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!