B is a 1x3 cell. The 1st element is empty (it doesn't matter because my loop will start at position 2). the other elements are 218x2 and 266x2.
I have a loop that is meant to do 'stuff', resulting in a vector 'cofcoefvector' that is 2X13. What I'm doing is partly correct, partly because row 1 and row 2 have the same values (the values are correct for r=3). Somehow, I repeat the operation. I think that's because I over-write C (see below) in the loop, and that because I haven't indexed it. I haven't done so, because I'm not able to.
tempmat1 = corrcoef(bpassf(C(:,2),6,32),lagmatrix(bpassf(C(:,1),6,32),j),'rows','complete');
corcoefvector(row,m) = tempmat1(1,2);
I thought that was because I (think, going through questions asked before on related issues) over-write C (see above) in the loop, and that because I haven't indexed it. I haven't done so, because I'm not able to.
So I took the largest dimension of the content of B, that is, 266x2 and pre-allocate C before the loop, so
C = zeros(266,2);
and change C=cell2mat(B(r)); to C(r)=cell2mat(B(r));
To no avail, I get 'Unable to perform assignment because the left and right sides have a different number of elements.'