How can I optimize (vectorize?) the following code in order to avoid the for loop and make the code to run faster?
for i=1:55; A(i)=B((i-1)*3+1,1); end
A is 1 x 55 and B is 165 x 1
C= B*3 +1 A (1:55, 1:55)= C(1:55, 1)
but the dimensions of ur matrices dont match , if B was 55 by 1 , it would have worked