MATLAB: Indexing to cell arrays

cell arraysfindindexingloopMATLAB

Hello, i am in need of a little guidance, i hope some of you can lead me in the right direction.
I am trying to write a program that stores the coloum number in a cell. I have an array X which contains 15000×14, and i want to store all the values that are between 0 and 1.
I have written a tiny matrix to illustrate our case:
X =
0.1 3 0.2
2 5 4
1 0.3 5
%The output should look something like this with a 0 to describe when the value is between 0 and 1
1 3
0
2
In some cases there are multiple values between 0 and 1 in the same coloum and I want to store them all.
My current line of code for looks like this, and it doesnt work apropriate:
[x,y] =find(0 < X & X < 1);

Best Answer

stepX={};
for j= 1:size(X,2)
j;
stepX{size(stepX,2)+1} = find(0 < X(:,j) & X(:,j) < 1);
end