MATLAB: How to combine several arrays

Image Processing Toolboxlocation of max value of arraysMATLAB

Dear all,
I have a variable that I named it 'Selec' that was inside a for-loop and it become like this
Selec = [0] [0] [1] [0] [0] [0]
I'm trying to know the location of the highest value. In this example it is 3. So how can I do that?
I tried to use the following 'max' but it is not working
[value,index] = max(Selec);
So is it possible to make Select like this
Selec = [001000] such that I can use 'max' to find the location of 1 which is 3 in this example.
Any help will be appreciated.
Meshoo

Best Answer

Apparently, Selec is a cell array. You can convert into a numerical array by concatenation:
Selec = {[0] [0] [1] [0] [0] [0] }
Selec2 = [Selec{:}]
[value,index] = max(Selec2)