Hi, I have the following code and I have to fill the array T with y every loop.
y=zeros();t=0;nraw=420for kk = 1:nrawfor iii = 1:length(comb)-1 %% NON MI PIACE IL MENO 1
t=t+1; if comb(t) == comb(t+1) y(iii) = 1 else y(iii) = 2 endendT(kk,:)=yend
The main problem is that length(comb) change every time, and so filling T I receive the following error
Unable to perform assignment because the size of the left side is 1-by-4 and the size of the right sideis 1-by-3.Error in TAMBURILIMITATI2507 (line 150)T(kk,:)=y
In fact, for the first iteration length(comb) was 5, but when become 4 the for cycle failed cause I cannot fill T
Do you know how to fix this case?
Best Answer