複数の比較対象に関してどのインデックスが一致しているかを知る方法
Show older comments
たとえば,配列
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)
とすることで所望の結果を得ることができましたが,もっと簡単な方法はないでしょうか?
Accepted Answer
More Answers (0)
Categories
Find more on Matrix Indexing in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!