Un-concatenate a vector to a matrix
3 views (last 30 days)
Show older comments
Lets say I have a 1x100 vector and I want to split it up into a 10x10 matrix. i.e:
vec1 = [100]
mat1 = [1-10;11-20;21-30; ... ;91-100]
is there a simple command for that?
0 Comments
Answers (2)
Image Analyst
on 7 Feb 2023
Try this:
% Define vec1:
vec1 = 100;
% Create mat1:
mat1 = reshape(1:vec1, 10, [])' % Reshape into 10 rows.
0 Comments
See Also
Categories
Find more on Logical 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!