How to get an Index for the Particular Element in array in simulink
56 views (last 30 days)
Show older comments
Greetings All, I am fairly new with Simulink, I am looking for the following, I have a 1D array [1, 9, 3, 2, 5, 8, 9] and i want to find the index of the value i am looking for for eg if i am looking for 9 i shall get 1 as answer and if i am looking for 8 i shall get 5 as answer, is there some block which can perform such operation, if not what will be the most efficient way to achieve this.
Regards Harjeet
Answers (1)
Walter Roberson
on 25 Sep 2015
compare http://www.mathworks.com/help/simulink/slref/comparetoconstant.html and send the result to find http://www.mathworks.com/help/simulink/slref/find.html
See Also
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!