I have an n*n matrix and I want to extract every 3 columns and keep the result in different variables.
n*n
I know that it is possible to do it in this way:
Don't create dynamic variables. If really needed, reshape A into a 3D array as follows:
A
A = reshape(A,size(A,1),3,[]); %where 3 is the number of columns you want to extract at a time