MATLAB: Converting logical to cell array

cell arrayserror

My code works with data extracted by a different code. Here it is:
for i=1:length(TrialTimestamps) %loop through trials
start1=TrialTimestamps(i);finish1=LightOnTimestamps(i); %trial onset to light on
temp1=(start1<=PokeTimestamps)&(PokeTimestamps<=finish1);% counts the nose pokes in this epoch
if temp1 == 0
temp1(i) = 0;
end
numpokes1(1,i)=temp1;
end
This is the error I receive: Unable to perform assignment because the size of the left side is 1-by-1 and the size of the right side is 61-by-1.
If I don't have numpokes, then temp1 only has logical, which cannot be used by the rest of the code. I need it to be in cell. I don't know how to turn it into a cell, but also preserve the entirety of the data.

Best Answer

I do not understand if ‘PokeTimeStamps’ changes its size (only that it appeasrs to be a column vector), or for that matter, what your code is doing.
One possibility:
numpokes1{:,i}=temp1;
That puts it in the column of cell array ‘numpokes’.
See if that does what you want.