convert vector to matrix
20 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Maina Kerbrat
am 31 Okt. 2018
Beantwortet: Star Strider
am 31 Okt. 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 Kommentare
Akzeptierte Antwort
Star Strider
am 31 Okt. 2018
Try this:
A = [1,2,3,4,5,6];
B = reshape(A(:), 3, []).'
B =
1 2 3
4 5 6
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Resizing and Reshaping Matrices finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!