I have 2 matrix, for example A(nx3) and B(mx3), and in the same code I have to change with same for loop something in them. But only changes one, other stays the same, what can be problem?
Y and Z can be any numbers that can be divided by size of matrix(if matrix are 20×3, Y or Z can be 2,4,5,10) code:
for k=0:100;A(k*(2*Y)+(Y+1):k*(2*Y)+(2*Y),1:3)=A(k*(2*Y)+(2*Y):-1:k*(2*Y)+(Y+1),1:3);end; for j=0:100;B(j*(2*Z)+(Z+1):j*(2*Z)+(2*Z),1:3)=B(j*(2*Z)+(2*Z):-1:j*(2*Z)+(Z+1),1:3);end;
Best Answer