Dividing a vector into a matrix
1 view (last 30 days)
Show older comments
I have a vector that has 40755 entries. I need to make this a multidimensional matrix where a new row is started every sixteenth entry. Any ideas? ex)
vector = [1,2,3,4,5,6,7,8,9,10,11,12]
split this up every third element
matrix [1,2,3
4,5,6
7,8,9,
10,11,12]
0 Comments
Accepted Answer
Star Strider
on 20 Mar 2015
I have no idea what shape you want your result matrix to be (it’s not clear from your question), so I can’t provide specific code. (The length of your vector is not evenly divisible by (12*16), so you have to be more specific with respect to what you want reshape to produce.)
0 Comments
More Answers (0)
See Also
Categories
Find more on Resizing and Reshaping Matrices in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!