testing test
Member level 3
Hello,
I have numbers from 0 1 2 3 4 5 6 7 and I want to divide it into 4 different arrays of [0 4], [2 6], [1 5] and [3 7]. How does MATLAB initialize arrays within the loop. Assume I don't know the total number of arrays to be created for a generic case where N could be any power of 2.
Please correct the above code. Thank you.
I have numbers from 0 1 2 3 4 5 6 7 and I want to divide it into 4 different arrays of [0 4], [2 6], [1 5] and [3 7]. How does MATLAB initialize arrays within the loop. Assume I don't know the total number of arrays to be created for a generic case where N could be any power of 2.
Code:
N=8;
for i=0:N/2-1
pair[i]=i:N/2:N-1
end
Please correct the above code. Thank you.