1

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]
4

1 に答える 1

1

Yes, you are looking for the reshape function. It works exactly as you have described.

于 2012-10-03T16:00:20.847 に答える