i would like to vectoralize the following codes with loop;
n=5;k=3;x=(k:n)';m=[];for i = 1 : (n-k+1) m=[m,x]; x=circshift(x,-1);end
example;
k=3, n=5 3 4 5,4 5 3,5 3 4
please help me out
MATLABvectorization
n=5;k=3;x=(k:n)';m=[];for i = 1 : (n-k+1) m=[m,x]; x=circshift(x,-1);end
k=3, n=5 3 4 5,4 5 3,5 3 4
Best Answer