Un-concatenate a vector to a matrix
3 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
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 Commenti
Risposte (2)
Image Analyst
il 7 Feb 2023
Try this:
% Define vec1:
vec1 = 100;
% Create mat1:
mat1 = reshape(1:vec1, 10, [])' % Reshape into 10 rows.
0 Commenti
Vedere anche
Categorie
Scopri di più su Logical in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!