I have a vector with lots of consecutive values, I want to write these values in to a matrix (to do something row-wise later) but I can't quite see how to do this. For example:
x = [1,2,4,5,7,8,9,11,12,13,14,15]
needs to become
y = [1,2;4,5;7,8,9;11,12,13,14,15]
I've seen a few similar posts that just check if the values are consecutive, but I can't see how to go from those posts to writing the matrix I want.
Edit: This is actually impossible as matrices need to be the same dimensions, (like I can't randomly have some rows longer than others) but I still can't see how to divide the vector up in to smaller sections of consecutive numbers.