MATLAB: How to make a loop for something like that:

buffereeg

for i=1:256
Y_666a(i) = buffer(sig(50335:51589,i),419);
end
sig(50335:51589,i) is a part of EEG signal and "i" is number of channel. I have 256 channels of record. When i try to make compilation i obtain an error:
In an assignment A(:) = B, the number of elements in A and B must be the same.
I need to have in loop something like that: Y_666a(1) = buffer(sig(50335:51589,1),419); Y_666a(2) = buffer(sig(50335:51589,2),419); Y_666a(3) = buffer(sig(50335:51589,3),419); . . . Y_666a(256) = buffer(sig(50335:51589,256),419); What i need to do? Thanks for all tips.

Best Answer

Y_666a = zeros(419,256) ;
for i=1:256
Y_666a(:,i) = buffer(sig(50335:51589,i),419);
end