convert vector to matrix
16 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Maina Kerbrat
il 31 Ott 2018
Risposto: Star Strider
il 31 Ott 2018
Hi all, I would like to convert a vector
A = [1,2,3,4,5,6]
to
matrix like that:
B=
[1 2 3,
4 5 6]
I tried to use reshape and I don't have vec2mat function. Do you have an idea? thank you
0 Commenti
Risposta accettata
Star Strider
il 31 Ott 2018
Try this:
A = [1,2,3,4,5,6];
B = reshape(A(:), 3, []).'
B =
1 2 3
4 5 6
0 Commenti
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Resizing and Reshaping Matrices 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!