MATLAB: How to find the index of a randomly chosen element of an array

find

Would anyone suggest me the code of finding out the index of a randomly selected element of an array or matrix?
For example, after randomly selecting an element from 'a', I want to find out the index number of the chosen element. This index number should be a variable as each time i randomly select an element, the corresponding index number of the selected element may change.
a = [4 5 10 15 20];

Best Answer

Try this
idx = find(a==random_element)