I have a 1x10
1D vector A=1:10;
and I want to convert it into a 5x2
2D vector
is there any function I can use like:
2dA = 1Dto2D(A,5,2);
and I get
2dA = [ 1 2 3 4 5
6 7 8 9 10]
Yes, you are looking for the reshape
function. It works exactly as you have described.